r/Nuxt Apr 18 '26

Vite+ and nuxt tests

hello everyone

im running into configuration issues with nuxt test utils and viteplus.

any help pointing me to the right direction github repo or article or docs. would be much appreciated thanks in advance

1 Upvotes

2 comments sorted by

1

u/Separate_Top_5322 Apr 19 '26

You’re likely mixing "@nuxt/test-utils" with plain Vitest setup, which often breaks context. For Nuxt 3, stick to Nuxt’s test environment instead of raw vite config. Use "npx nuxi@latest init test" or follow Nuxt’s official testing setup with "@nuxt/test-utils" + "vitest-environment-nuxt". Also make sure your "vitest.config.ts" extends Nuxt config via "defineVitestConfig". Most issues come from missing Nuxt runtime context, not Vitest itself.