-
Notifications
You must be signed in to change notification settings - Fork 103
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Environment
- Operating System:
Darwin - Node Version:
v22.17.1 - Nuxt Version:
4.0.3 - CLI Version:
3.28.0 - Nitro Version:
2.12.4 - Package Manager:
[email protected] - Builder:
- - User Config:
compatibilityDate,devtools,modules - Runtime Modules:
@nuxt/[email protected] - Build Modules:
-
Reproduction
https://github.com/JessicaSachs/nuxt-vitest-flake-repro
I'm looking to use host in order to point my e2e tests at an already-built Nuxt application. To run the suite, first build the application:
pnpm buildAnd then run the tests via:
pnpm test:e2eDescribe the bug
I'm unable to run tests reliably. The E2E test run exits after first suite (Either Node or Nuxt) passes. I get flake 20% of the time. My coworker gets it about 80% of the time. Pretty sure it's related to the machine speed.
Additional context
I've tried doing things like forcing Vitest's parallelization to turn off and poolOptions/maxThreads to be 1. Can't find a workaround rn.
Logs
FAIL nuxt test/e2e/home.test.ts [ test/e2e/home.test.ts ]
Error: Failed to resolve import "#app/nuxt-vitest-app-entry" from "node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_playwri_9da3baa23bc5990d9fca0e90d773c266/node_modules/@nuxt/test-utils/dist/runtime/shared/nuxt.mjs". Does the file exist?
Plugin: vite:import-analysis
File: /Users/jess/projects/jess-ecosystem/nuxt-vitest-flake-repro/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_playwri_9da3baa23bc5990d9fca0e90d773c266/node_modules/@nuxt/test-utils/dist/runtime/shared/nuxt.mjs:3:15
1 | export async function setupNuxt() {
2 | const { useRouter } = await import("#app/composables/router");
3 | await import("#app/nuxt-vitest-app-entry").then((r) => r.default());
| ^
4 | const nuxtApp = useNuxtApp();
5 | await nuxtApp.callHook("page:finish");