@lpsmods/minecraft-server-ui-mock
v0.0.1
Published
@minecraft/server-ui mocks for testing.
Readme
@lpsmods/minecraft-server-ui-mock
Emulates the @minecraft/server-ui package for testing.
What is this?
This package provides a mocked version of @minecraft/server-ui for testing. It helps you run unit tests without needing the real Minecraft Bedrock scripting environment.
Using with Vitest
Install the mock package as a dev dependency:
npm install -D @lpsmods/minecraft-server-ui-mockThen alias @minecraft/server-ui in your vitest.config.ts:
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
},
resolve: {
alias: {
"@minecraft/server-ui": "@lpsmods/minecraft-server-ui-mock",
},
},
});Now your source code can keep importing from @minecraft/server-ui, and when running tests, Vitest will automatically redirect those imports to this mock package.
Not associated with or approved by Mojang Studios or Microsoft
