Ayho
Test plugin of useNuxtApp vitest
Hello all,
I don't know how to test one of my services I pass through useNuxtApp.
I use @nuxt/test-utils and my component got a
const { $someService } = useNuxtApp();
and in my test I want to mock it and try like this
I get this error :
[vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file
What am I doing wrong ?6 replies