e2e setup() leaves its random .nuxt/test/<id> build directory behind after every run
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, nuxt, typescript
- Lĩnh vực
- testing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 445
- Fork
- 121
- Merge trung bình
- 3 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nuxt/test-utils
-
nuxt environment: `fetch(new Request(url))` fails with `Failed to parse URL from [object Request]`Có thể đã có người làm @yamachi4416 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
nuxt/test-utils#1891 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
nuxt/test-utils#1883 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
pending triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
nuxt/test-utils#1671 · 5 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
pending triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
nuxt/test-utils#1607 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`@vitest-environment-options` is not workingCó thể đã có người làm @yamachi4416 đã nhận 210 ngày trước. Đang mởpending triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
nuxt/test-utils#1541 · 2 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của nuxt/test-utils
Issue tương tự
-
bug priority: low role: BE stage: now
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
ahmadrosid/nakama#2594 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
milind-soni/OpenMausBot#6495 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Navigating the session tree adds the branch's prompts to Up-arrow history againCó thể đã có người làm @acmerfight đã nhận hôm nay. Đang mởuntriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
earendil-works/pi#12279 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
approved documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 89/100
vitest-dev/vitest#12015 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày