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
Stryker's vitest runner drops vitest.mutate.config.ts's testNamePattern, so the clock-face test it means to skip still runs #1940
vitest.mutate.config.ts:13 sets testNamePattern to leave out ui/src/model/events.test.ts:148 ("is its time of day on the browser's clock face"), because that test sets process.env.TZ, which a worker thread ignores.
@stryker-mutator/vitest-runner 10.1.1 overwrites that pattern on every project in each run without test ids, the dry run included (node_modules/@stryker-mutator/vitest-runner/dist/src/vitest-test-runner.js:216-219):
So the dry run runs the clock-face test anyway. In the thread pool it fails:
$ pnpm exec vitest run --config vitest.mutate.config.ts --pool threads ui/src/model/events.test.ts -t "clock face"
× is its time of day on the browser's clock face
AssertionError: expected '13:30:00' to be '17:00:00'
I read this from the runner's code and did not run Stryker (agents may not). If it holds, a pnpm mutate run whose test files include ui/src/model/events.test.ts (a mutant in ui/src/model/events.ts or something it imports) fails its first run. Possible fixes: exclude the test some other way (for example a skipIf on worker threads), or make it not depend on process.env.TZ.
I could not reproduce this with the installed Vitest (5.1.0, ^5.0.5 in package.json). The dry run keeps the config's pattern, so the clock-face test is skipped and does not fail.
Why the runner's line does nothing here: Vitest 5.1.0 copies a config's testNamePattern into vitest.configOverride at start (node_modules/vitest/dist/chunks/cli-api.COfZo8lK.js:12984). Each project's serialized config is then merged under that override (node_modules/vitest/dist/chunks/index.Di8au7q4.js:6762-6766). The runner's project.config.testNamePattern = undefined (vitest-test-runner.js:216-219) writes to the project's config, which sits under the override, so the pattern survives.
What I tried: a unit test that creates Vitest in-process the way the runner's init() does (createVitest("test", { config: "vitest.mutate.config.ts", pool: "threads", maxWorkers: 1, watch: false })). It set every project's testNamePattern to undefined, as the runner's dry run does, and ran ui/src/model/events.test.ts:
12 pass, "is its time of day on the browser's clock face" skipped, 0 fail
project.config.testNamePattern after the write: undefined
The command in the report fails for a different reason: -t "clock face" is a CLI pattern and replaces the config's pattern, so the test runs in a thread and fails. A Stryker dry run passes no -t.
What would let me reproduce it: the output of a real pnpm mutate run (the maintainer's, or the harden-tests routine's) whose first run fails on "is its time of day on the browser's clock face", with the Vitest and @stryker-mutator/vitest-runner versions it used. Or a Vitest version this repo supports that does not keep the pattern in configOverride.
A related problem I did find, filed as #1953: the same override also beats the runner's per-mutant filter (vitest-test-runner.js:212-215). Each mutant runs every test in its files, not just the ones that cover it.
Activity
V3RON commentedon Nov 29, 2026
I could not reproduce this with the installed Vitest (5.1.0,
^5.0.5inpackage.json). The dry run keeps the config's pattern, so the clock-face test is skipped and does not fail.Why the runner's line does nothing here: Vitest 5.1.0 copies a config's
testNamePatternintovitest.configOverrideat start (node_modules/vitest/dist/chunks/cli-api.COfZo8lK.js:12984). Each project's serialized config is then merged under that override (node_modules/vitest/dist/chunks/index.Di8au7q4.js:6762-6766). The runner'sproject.config.testNamePattern = undefined(vitest-test-runner.js:216-219) writes to the project's config, which sits under the override, so the pattern survives.What I tried: a unit test that creates Vitest in-process the way the runner's
init()does (createVitest("test", { config: "vitest.mutate.config.ts", pool: "threads", maxWorkers: 1, watch: false })). It set every project'stestNamePatterntoundefined, as the runner's dry run does, and ranui/src/model/events.test.ts:The command in the report fails for a different reason:
-t "clock face"is a CLI pattern and replaces the config's pattern, so the test runs in a thread and fails. A Stryker dry run passes no-t.What would let me reproduce it: the output of a real
pnpm mutaterun (the maintainer's, or theharden-testsroutine's) whose first run fails on "is its time of day on the browser's clock face", with the Vitest and@stryker-mutator/vitest-runnerversions it used. Or a Vitest version this repo supports that does not keep the pattern inconfigOverride.A related problem I did find, filed as #1953: the same override also beats the runner's per-mutant filter (
vitest-test-runner.js:212-215). Each mutant runs every test in its files, not just the ones that cover it.Written by an agent.