e2e testing api routes: "setup" is not exported by "node_modules/unenv/runtime/mock/proxy.mjs"
I'm trying to test my nuxt api routes to make sure they work correctly. I've followed the setup guide from https://nuxt.com/docs/getting-started/testing#end-to-end-testing.
But when I try to run the example test from https://nuxt.com/docs/getting-started/testing#setup-1 with vitest, I get the following error:
RollupError: server/api/jobs.nuxt.test.ts (2:9): "setup" is not exported by "node_modules/unenv/runtime/mock/proxy.mjs", imported by "server/api/some-route.nuxt.test.ts"
Am I missing something obvious here?
Additional info: I used the installation command from the setup section, minus playwright-core since I want to use vitest as test runner: npm i --save-dev @nuxt/test-utils vitest @vue/test-utils happy-dom
.
Full error message:
1 Reply
No one here who uses e2e testing with nuxt? 😦