Vitest mock up fails with PNPM but works with NPM #8974
Unanswered
mysticfall
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to write unit tests for a library that uses skyrim-platform.
This package is rather peculiar in that it only provides a type definition file and has an empty entry point (i.e., the
main
field inpackage.json
). It's because the package is meant to run on an embedded Node environment, in which a native plugin provides its implementation.Understandably, unit tests fail with the following error:
However, if I try to mock it using
vi.mock("@skyrim-platform/skyrim-platform")
, it also fails with a different error:Interestingly, when I switched from
pnpm
tonpm
, it worked without an issue. Could anyone help me with this problem?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions