Skip to content
Discussion options

You must be logged in to vote

Hey, thanks for the detailed report and the workaround.

This was caused by missing .js extensions in the ESM output of @suites/doubles.vitest (and all other packages). Under NodeNext module resolution, Node.js requires explicit extensions on relative imports. Without them, the ESM entry point fails to load and Suites silently falls back to the CJS build. The CJS build exports StubbedInstance rather than Mocked, which is why unitRef.get() was returning the wrong type.

Fixed in 3.1.0-dev.0. You can test it now:

npm install @suites/unit@dev @suites/doubles.vitest@dev @suites/di.nestjs@dev

The unitRefMock workaround should no longer be needed. Let us know if you still see the issue after upgr…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by omermorad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants