e2e setup() leaves its random .nuxt/test/<id> build directory behind after every run
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, nuxt, typescript
- Ambito
- testing
Direzione di ricerca
The issue points to loadFixture in the generated dist/e2e-*.mjs and shows the cleanup registration condition. Trace this code to its source and check how loadNuxt() creates the build directory and how teardown runs. Reproduce with the provided Vitest e2e test; done when the test-created random build directory is removed after the test finishes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Environment
@nuxt/test-utils4.1.0,nuxt4.5.2, Node 22.21.1, macOS
What happens
Every run of an e2e test that uses setup({ server: true }) (build mode, no buildDir option) leaves its random build directory, .nuxt/test/<randomId> (about 23 MB for our app), behind after the run finishes. They pile up, one per run.
Why
In loadFixture (dist/e2e-*.mjs), the teardown that removes the build directory is only registered when the directory does not exist after loadNuxt():
ctx.nuxt = await loadNuxt({ ... overrides: ctx.options.nuxtConfig ... })
const buildDir = ctx.nuxt.options.buildDir
if (!existsSync(buildDir)) {
await promises.mkdir(buildDir, { recursive: true })
ctx.teardown = ctx.teardown || []
ctx.teardown.push(() => promises.rm(buildDir, { recursive: true, force: true }))
}
On our app loadNuxt() has already created the directory by that point, so the cleanup is never registered.
Steps to reproduce
- In a Nuxt 4 app, add a test:
// @vitest-environment node import { expect, it } from "vitest"; import { fetch, setup } from "@nuxt/test-utils/e2e"; await setup({ server: true, browser: false }); it("serves /", async () => { expect((await fetch("/")).status).toBe(200); }); - Run it with
npx vitest run <file>; it passes. ls .nuxt/testshows a<randomId>directory left behind. Each further run adds another.
Expected
The build directory created for the test is removed when the test finishes.
- Lingua principale
- TypeScript
- Stelle
- 445
- Fork
- 121
- Merge medio
- 3g 11h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nuxt/test-utils
-
nuxt environment: `fetch(new Request(url))` fails with `Failed to parse URL from [object Request]`Forse già presa @yamachi4416 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
nuxt/test-utils#1891 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
nuxt/test-utils#1883 ·
I maintainer di solito rispondono entro 2 giorni
-
pending triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
nuxt/test-utils#1671 · 5 commenti · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
pending triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
nuxt/test-utils#1607 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
`@vitest-environment-options` is not workingForse già presa @yamachi4416 l’ha presa 210 giorni fa. Apertapending triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
nuxt/test-utils#1541 · 2 reazioni ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di nuxt/test-utils
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Search input loses focus while typing on the Inventory, Reservations and Locations lists (view_configurations enabled)Forse già presa @medusa-os-bot l’ha presa oggi. Apertastatus: needs triaging type: bug version: 2.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
medusajs/medusa#17886 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
marimo-team/marimo#11949 ·
I maintainer di solito rispondono entro 1 giorno
-
bug server-time v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
modelcontextprotocol/servers#5559 ·
I maintainer di solito rispondono entro 1 giorno
-
D1 Time Travel restore help advertises 30 days without a plan qualifierForse già presa @akhil9tiet l’ha presa oggi. Apertabug package:wrangler product:d1
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
cloudflare/workers-sdk#17000 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno