Skip to content

feat(core): add StrykerJS mutation testing via the command test runner - #107

Merged
Mearman merged 2 commits into
mainfrom
chore/stryker-core
Sep 13, 2026
Merged

feat(core): add StrykerJS mutation testing via the command test runner#107
Mearman merged 2 commits into
mainfrom
chore/stryker-core

Conversation

@Mearman

@Mearman Mearman commented Sep 13, 2026

Copy link
Copy Markdown
Member

Fixes #67

Adds a stryker.config.ts for ts/packages/core using testRunner: "command" instead of @stryker-mutator/vitest-runner. That plugin's 10.0.0 crashes on init against vitest 5.0.0 (this package's installed version) with a circular-structure-to-JSON error while serialising vitest's own resolved config, thrown from VitestTestRunner.init. No fix or compatible version pairing is available upstream yet (matches stryker-mutator/stryker-js's own vitest-runner issue tracker, and Chris0Jeky/Taskdeck#3038 independently hits the identical "0.00 tests per mutant" symptom against the same vitest major).

The command runner re-runs pnpm exec vitest run as a subprocess per mutant. It loses per-test coverage analysis (every mutant re-runs the whole suite rather than only its covering tests) but produces a real, working result rather than an immediate crash.

test/conformance.test.ts is excluded from the mutation command specifically: it reads its vectors from a sibling package via a relative path that escapes Stryker's per-package sandbox root, so it fails with ENOENT for every mutant regardless of the mutation, not a real coverage signal. _conformance-check already runs it separately, unmutated.

First baseline, run locally: 67.23% mutation score (526 killed, 30 timeout, 271 survived, 0 no-coverage, 678 non-viable/compile-error mutants). No thresholds.break set yet — this PR's job is the baseline itself; fixing what it finds and setting a real break threshold is #68's own separate work.

stryker.config.ts is added to tsconfig.node.json's include list so ESLint's typed linting can parse it, matching how generate.ts/tsdown.config.ts/etc are already included there.

Adds stryker.config.ts, a turbo _mutation task, and .gitignore entries for its temp/report directories. Uses testRunner: "command" (re-running pnpm exec vitest run per mutant as a subprocess) rather than @stryker-mutator/vitest-runner: that plugin's 10.0.0 release crashes on init against vitest 5.0.0 with a circular-structure-to-JSON error while serialising vitest's resolved config, a confirmed upstream incompatibility with no fix or compatible version pairing available yet. The command runner loses per-test coverage analysis (every mutant re-runs the whole suite) but produces a real result instead of a silent, meaningless zero score.

test/conformance.test.ts is excluded from the mutation test command specifically: it reads its vectors from a sibling package via a relative path that escapes Stryker's per-package sandbox root, so it fails with ENOENT for every mutant regardless of the mutation. _conformance-check already runs it separately, unmutated.

stryker.config.ts is added to tsconfig.node.json's include list so ESLint's typed linting can parse it.
@Mearman
Mearman marked this pull request as ready for review September 13, 2026 06:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-13T06:14:04.648352Z 2caf6c1 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

stryker.config.ts imports PartialStrykerOptions from @stryker-mutator/api/core, but the package was only ever hoisted transitively through @stryker-mutator/core's own dependency on it. That resolved locally but failed CI's typecheck with TS2307 (module not found), since a transitive resolution isn't a guarantee any package manager owes a direct import.
@Mearman
Mearman merged commit 1d98817 into main Sep 13, 2026
8 checks passed
@Mearman
Mearman deleted the chore/stryker-core branch September 13, 2026 06:15
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.

Add stryker.config.ts to ts/packages/core

1 participant