e2e setup() leaves its random .nuxt/test/<id> build directory behind after every run
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, nuxt, typescript
- 領域
- testing
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 445
- フォーク
- 121
- 平均マージ
- 3日 11時間
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nuxt/test-utils のほかの issue
-
nuxt environment: `fetch(new Request(url))` fails with `Failed to parse URL from [object Request]`対応中かも @yamachi4416 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
nuxt/test-utils#1891 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
nuxt/test-utils#1883 ·
メンテナーはふだん 2 日以内に返信
-
pending triage
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
nuxt/test-utils#1671 · コメント 5 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
pending triage
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
nuxt/test-utils#1607 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
`@vitest-environment-options` is not working対応中かも @yamachi4416 が 210 日前に担当しました。 オープンpending triage
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
nuxt/test-utils#1541 · リアクション 2 件 ·
メンテナーはふだん 2 日以内に返信
nuxt/test-utils の issue をすべて見る
似ている issue
-
bug priority: low role: BE stage: now
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
ahmadrosid/nakama#2594 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
milind-soni/OpenMausBot#6495 ·
メンテナーはふだん 1 日以内に返信
-
Navigating the session tree adds the branch's prompts to Up-arrow history again対応中かも @acmerfight が今日担当しました。 オープンuntriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
earendil-works/pi#12279 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
approved documentation
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
vitest-dev/vitest#12015 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信