Vitest not resolving auto-imports #16878
Replies: 2 comments 1 reply
-
you find some about it? |
Beta Was this translation helpful? Give feedback.
-
Hello, I found a solution for this problem. Found the example here: https://medium.com/@ana.robles.developer/nuxt-3-vitest-vue-test-utils-mockear-en-los-test-funciones-auto-importadas-2242297eb06d |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I'm trying to setup Vitest to work with Nuxt 3, but I'm running into auto-import issues.
I have a simple server side route which uses
defineEventHandler
which is automatically imported when Nuxt runs, but this is not the case when running Vitest.The test fails with the following error.
I created a Stackblitz with a reproduction https://stackblitz.com/edit/nuxt-starter-nvmcae
Run
npm run test
to run the tests.Does anyone know how to configure Vitest to work with Nuxt 3 smoothly?
Beta Was this translation helpful? Give feedback.
All reactions