Configuration Vitest in Nuxt 3



This content originally appeared on DEV Community and was authored by JJBit “Julio”

Good afternoon, everyone! How are you?

I have a large project made with Nuxt 3, Vue, Pinia, Axios, and TypeScript.

Can you help me fully configure Vitest in my project? I’ve had many problems. For example, I wrote a test and it didn’t recognize the components folder with ~/ or @/ etc.

Now I have a problem: ‘Error: Nuxt instance unavailable’ when testing a function file with an (axios) API, and it gives this error.


This content originally appeared on DEV Community and was authored by JJBit “Julio”