Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defineVitestConfig from @nuxt/test-utils is not a drop-in replacement for defineConfig from vite (No test suite found in file) #826

Open
Llois41 opened this issue Apr 23, 2024 · 1 comment

Comments

@Llois41
Copy link

Llois41 commented Apr 23, 2024

Environment

  • Operating System: Darwin
  • Node Version: v18.20.1
  • Nuxt Version: 3.6.5
  • Nitro Version: 2.5.2
  • Package Manager: yarn@4.1.0
  • Builder: vite
  • User Config: srcDir, buildDir, modules, ssr, nitro, serverHandlers, css, components, imports, build, builder, typescript, vue, hooks
  • Runtime Modules: @nuxt/test-utils/module@3.12.0
  • Build Modules: -

Reproduction

Unfortunately I could not reproduce this behaviour in a fresh repo.

Describe the bug

Using defineVitestConfig from @nuxt/test-utils gives me some errors on random(?) test files located in a specific folder (./src/plugins/ in this case). It seems that vitest doesn't find those tests inside this directory (No test suite found in file /omniweb/gsd/src/plugins/frontend-commons.spec.ts). I tried to place a simple test.spec.ts inside with a basic test but it doesn't pick that up either.
However if I move those test files to another directory at the same level (plugins2) it runs those test. If I rename the folder to plugins it again does not run those test files...

I really can't imagine what's going on here. Are there some forbidden path patterns for some reason?

Additional context

If I use defineConfig from vite these tests will run. But I need to use the Nuxt import since it helps with those nuxt import aliases like #app etc.

Logs

No response

@ennioVisco
Copy link

I am also getting this issue, but it's related to latest vitest versions, it was not present before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants