Skip to content

feat(vitest-runner): report test locations - #6188

Open
christopher-buss wants to merge 1 commit into
stryker-mutator:masterfrom
christopher-buss:feat/vitest-runner-test-locations
Open

feat(vitest-runner): report test locations#6188
christopher-buss wants to merge 1 commit into
stryker-mutator:masterfrom
christopher-buss:feat/vitest-runner-test-locations

Conversation

@christopher-buss

Copy link
Copy Markdown

Enable vitest's includeTaskLocation and translate the reported task location into the startPosition that the test runner API already carries, and that the jest-runner and cucumber-runner report today.

Incremental mode uses the test locations to diff test files. Without them, Stryker has to assume that every test in a changed test file changed, so it reruns every mutant covered by that file. With them, only the mutants covered by the tests that actually changed are rerun. This moves the vitest runner from "tests per file without location" to "full" test reporting.

Stryker stores 0-based lines and columns internally. Vitest builds the location from a V8 stack trace, so both its line and its column are 1-based, and both are decremented. The jest-runner decrements the line only, because jest takes its columns from babel, where they are already 0-based.

Closes #6186.

AI Attribution:
Assisted via Claude Code but reviewed and filed by myself.

Enable vitest's `includeTaskLocation` and translate the reported task
location into the `startPosition` that the test runner API already
carries, and that the jest-runner and cucumber-runner report today.

Incremental mode uses the test locations to diff test files. Without
them, Stryker has to assume that every test in a changed test file
changed, so it reruns every mutant covered by that file. With them, only
the mutants covered by the tests that actually changed are rerun. This
moves the vitest runner from "tests per file without location" to "full"
test reporting.

Stryker stores 0-based lines and columns internally. Vitest builds the
location from a V8 stack trace, so both its line and its column are
1-based, and both are decremented. The jest-runner decrements the line
only, because jest takes its columns from babel, where they are already
0-based.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vitest-runner: report test locations so incremental mode gets "Full" test reporting

1 participant