Describe the bug
Running vitest with this package throws an unexpected error.
Error: Cannot find package '../index.js' imported from @minecraft\math\lib\src\aabb\coreHelpers.js
Steps To Reproduce
- Install
@lpsmods/minecraft-server-mock.
- Use
@minecraft/server in a unit test.
- Include
resolve.alias in your vitest config as defined on NPM.
- Run tests.
- Get an error while running tests.
Expected behavior
No error. Tests run as expected.
2.4.0
Package
@lpsmods/minecraft-server-mock
Package Version
0.0.1
Platform
Any
Additional context
This problem can be fixed by including server.deps.inline in your vitest config file.
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
environment: "node",
server: {
deps: {
inline: ["@minecraft/math"],
},
},
},
resolve: {
alias: {
"@minecraft/server": "@lpsmods/minecraft-server-mock",
},
},
});
Describe the bug
Running vitest with this package throws an unexpected error.
Steps To Reproduce
@lpsmods/minecraft-server-mock.@minecraft/serverin a unit test.resolve.aliasin your vitest config as defined on NPM.Expected behavior
No error. Tests run as expected.
@minecraft Module Version
2.4.0
Package
@lpsmods/minecraft-server-mock
Package Version
0.0.1
Platform
Any
Additional context
This problem can be fixed by including
server.deps.inlinein your vitest config file.