Mocking imported nuxt modules using @nuxt/test-utils environment
i have a
vitest.config.ts
that looks like this:
my setup file:
my fixture class:
an example of the "mocked nuxt modules" i'm trying to use:
given the above, how can i use my mocked modules in a vitest test? everytime i run the tests it seems to pick up my "real" module implementations, not the mocked ones1 Reply
i'm surprised by how difficult it is to get something like this working
for anyone else interested: the main issue was export default and not export default defineNuxtModule
at least for a unit test within a nuxt environment, e2e tests still seem to use my actual module implementations for now….