Mocking does not persist using @nuxt/test-utils #729
Unanswered
silverbackdan
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
-
Before I try to trace this and raise an issue, is anyone else having issues with mocking?
E.g. I'll mock
vi.mock('mitt')
and in the test file it is a mock, but the class I am mocking still uses the original.This is resolved by changing the environment to
node
orhappy-dom
if I need the window as well.I've done workarounds by using
happy-dom
mostly but it's quite weird which mocks do not persist, I haven't found a pattern for it.If there are any open issues I've missed, or anyone has experienced this issue and perhaps there was a big change from the major 1.0.0 releases would be great to know.
Happened after updating from the old package name and into this shiny new @nuxt/test-utils one.
Beta Was this translation helpful? Give feedback.
All reactions