test: drain DOM tasks before MSW shutdown - #6895
Conversation
UX Review (Fable 5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS No user-facing surface is touched — only Vitest teardown ordering, test assertions, and worker flags — so there is no rendered experience to evaluate. [UX-REVIEWED] a973d0c |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Root-cause fix: reorders teardown so DOM work drains under live interception, correctly replacing a process-level rejection filter that could mask real defects. Watch
Suggestions
[DESIGN-REVIEWED] a973d0c |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsBoth candidates fail falsification: Candidate 1 ( Candidate 2 (removed unhandled-rejection guard): The discovery pass states outright it "could not construct a concrete surviving task" that escapes No grounded Step 2 findings: the setup refactor, structural-pin string search ( No findings. [OPUS-REVIEWED] a973d0c |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Problem / Motivation
The full Vitest suite could finish every assertion and still fail during worker teardown. happy-dom could leave an iframe or resource fetch queued until after MSW closed, producing an unhandled
AbortErroror a realECONNREFUSEDdial to the test origin. Node 25 workers also exposed process-global experimental Web Storage without a persistence path, emitting a warning for every test file.Why it matters
These failures move between shards with worker timing and obscure real failures. A global rejection filter would also risk hiding genuine application defects, so the test lifecycle itself needs to be deterministic.
What changed
window.happyDOMunhandledRejectionsuppression forAbortErrorandECONNREFUSEDGlobal overlap audit
All open PRs were checked for the four changed files. #4913 touches the build-plugin list in
vite.config.ts; #5274 touches the coverage exclude list. This PR changes only the Vitest workerexecArgvregion, so neither contributor's behavior or hunk is replaced.Tests
npm run typecheckgit diff --checkmainECONNREFUSEDor process-global localStorage warning; unrelated deterministic failures found there are being fixed separately rather than hidden hereScreenshot evidence
Why no screenshot: This changes only the Vitest worker environment, shared test teardown, and deterministic test coverage; no rendered component, layout, style, motion, or interaction behavior changes.
Checklist