You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vitest.mutate.config.ts takes the console's DOM tests and runs them with no DOM, so all 21 fail #1938
vitest.mutate.config.ts:8 includes ui/**/*.test.{ts,tsx}, and its exclude list (line 10) leaves out only *.timing.test.ts. That pulls in every ui/**/*.dom.test.tsx. The unit project in vitest.config.ts leaves those files out, and the ui-dom project gives them environment: "happy-dom" and ui/src/test/setup.ts. The mutation config gives them neither.
On main at 6552987c6, pnpm exec vitest run --config vitest.mutate.config.ts fails 198 tests across all 21 DOM files, the same in the thread and the fork pool:
ReferenceError: window is not defined (179 tests)
ReferenceError: HTMLElement is not defined (19 tests)
A mutation run whose test files include a DOM file (a mutated ui/src/ file that a page test imports) fails its first run. Fix options: exclude ui/**/*.dom.test.tsx in the mutation config, or give it the ui-dom project.
Confirmed: all 21 DOM files, 198 tests, fail under the mutation config. src/test-lanes.repo.test.ts, "the mutation config (vitest.mutate.config.ts) › runs the console's DOM test files with the DOM the ui-dom project gives them, in Stryker's thread pool, and they pass", on bug/1938-repro. It runs two files: one fails inside a test, one fails while it loads.
pnpm exec vitest run --project unit src/test-lanes.repo.test.ts -t "mutation config"
- "errors": [],
+ "errors": ["ReferenceError: window is not defined"],
"file": "ui/src/app/inbox-count.dom.test.tsx",
- "status": "passed",
+ "status": "failed",
- "errors": [],
+ "errors": ["HTMLElement is not defined"],
"file": "ui/src/screens/fleet/worker-page.dom.test.tsx",
The test pins one of the issue's two options: the DOM tests run, with their DOM. Excluding them fails it.
Root cause
Defect. vitest.mutate.config.ts:8 copies the unit project's include list from before #1454 (caa5b4e). That change moved ui/**/*.dom.test.tsx into a new ui-dom project with happy-dom and ui/src/test/setup.ts, and added them to unit's exclude list. The mutation config was not updated, so its single Node project still takes the DOM files and runs them without window. The symptom shows in Stryker's first run. The cause is the config drifting from vitest.config.ts:21-28,39-53.
Simplest fix
Split vitest.mutate.config.ts into two extends: true projects. unit: today's include list, with ui/**/*.dom.test.tsx added to exclude. ui-dom: the same environment, environmentOptions, setupFiles and css as vitest.config.ts.
repro: 12 passed (test-lanes.repo.test.ts)
all 21 DOM files, mutation config, --pool threads: 220 passed
src/mutate.test.ts: 16 passed
vitest list: the same 750 files before and after
Alternatives rejected
Exclude the DOM tests (the issue's first option): mutants that only page tests kill would show as alive. That breaks delivery rule 18, which counts "the existing tests".
Import vitest.config.ts's projects: unit would also bring in packages/* and its setup file, which widens the change.
Risk
The ui-dom block copies vitest.config.ts, so the two can drift apart again.
Mutation runs on ui/src/ take page tests: slower near and wide passes.
Not run under Stryker. Agents may not run it, so the first harden-tests run is the real check.
Fast track
Defect: yes
Fix tried: yes
Nothing public added or broken: yes
No ADR or rule changed: yes
One fix: no — excluding the DOM tests changes which mutants a run reports alive
Maintainer decision on the triage report (2026-11-30):
Approved as proposed: the mutation config runs the console's DOM tests with their DOM.
Deliver it after #1937 merges. #1937 moves Stryker's pool from threads to forks, so the reproduction's "in Stryker's thread pool" must follow that change.
Activity
V3RON commentedon Nov 28, 2026
Reproduction
Confirmed: all 21 DOM files, 198 tests, fail under the mutation config.
src/test-lanes.repo.test.ts, "the mutation config (vitest.mutate.config.ts) › runs the console's DOM test files with the DOM theui-domproject gives them, in Stryker's thread pool, and they pass", onbug/1938-repro. It runs two files: one fails inside a test, one fails while it loads.The test pins one of the issue's two options: the DOM tests run, with their DOM. Excluding them fails it.
Root cause
Defect.
vitest.mutate.config.ts:8copies theunitproject's include list from before #1454 (caa5b4e). That change movedui/**/*.dom.test.tsxinto a newui-domproject with happy-dom andui/src/test/setup.ts, and added them tounit's exclude list. The mutation config was not updated, so its single Node project still takes the DOM files and runs them withoutwindow. The symptom shows in Stryker's first run. The cause is the config drifting fromvitest.config.ts:21-28,39-53.Simplest fix
Split
vitest.mutate.config.tsinto twoextends: trueprojects.unit: today's include list, withui/**/*.dom.test.tsxadded to exclude.ui-dom: the same environment,environmentOptions,setupFilesandcssasvitest.config.ts.Alternatives rejected
vitest.config.ts's projects:unitwould also bring inpackages/*and its setup file, which widens the change.Risk
ui-domblock copiesvitest.config.ts, so the two can drift apart again.ui/src/take page tests: slower near and wide passes.harden-testsrun is the real check.Fast track
Side findings
Written by an agent.
V3RON commentedon Nov 30, 2026
Maintainer decision on the triage report (2026-11-30):
Approved as proposed: the mutation config runs the console's DOM tests with their DOM.
Deliver it after #1937 merges. #1937 moves Stryker's pool from threads to forks, so the reproduction's "in Stryker's thread pool" must follow that change.
Written by an agent.
docs: the mutation script's comment names both projects the config ru…
fix(test): the nested-Vitest mutation test leaves the repo-test hook,…
V3RON commentedon Nov 30, 2026
Delivery run
Merged: #1961 (#1938)
Written by an agent.
fix(test): the mutation config runs the console's DOM tests with thei…