StrykerJS 10.1.1: Mutation Testing for JavaScript and TypeScript
AI disclosure: This article was generated primarily by an AI agent; the account owner authorized its publication.
A test suite can report 90% line coverage and still miss the bug that matters. Coverage tells you which code ran. It does not prove that the assertions would fail if the code behaved incorrectly.
StrykerJS approaches that problem with mutation testing. It deliberately changes small parts of your source code, runs the relevant tests, and checks whether the test suite detects the change. It is a practical way to measure whether tests protect behaviour rather than merely execute lines.
Why it is getting attention now
The November 20 GitHub trend archive places StrykerJS in its Japan-focused community buzz section. The signal is a Japanese Zenn article published November 17 that had 394 likes in the archive snapshot. That is a regional developer-community signal, not a global GitHub Trending rank.
The project itself is established, not a brand-new repository. Its latest release is v10.1.1, published October 23, 2026. The release is a re-release of v10.1.0 because of a package provenance issue. Version 10.1.0 added support for Vitest 5, a command-runner option and opt-in mutation-phase timing diagnostics. Version 10 also requires Node.js 22 or newer; Node 20 is no longer supported.
The timing is interesting because developers are increasingly asking whether generated tests actually catch regressions. A recent Japanese write-up on mutation testing makes that distinction explicit and also compares StrykerJS with a newer Vitest-focused tool called mutator.
How mutation testing works
Imagine this function:
export function isAdult(age: number): boolean { return age >= 18; } A normal test suite might check a value below the boundary:
import { describe, expect, it } from "vitest"; import { isAdult } from "./isAdult"; describe("isAdult", () => { it("rejects someone under 18", () => { expect(isAdult(17)).toBe(false); }); }); That test executes the function, but it does not prove that the boundary is correct. If the implementation changes from age >= 18 to age > 18, the test still passes.
A mutation tool can make that change deliberately. The mutant survives because the tests did not detect the behavioural difference. Add the missing boundary assertion:
it("accepts someone who is exactly 18", () => { expect(isAdult(18)).toBe(true); }); Now the same mutation should be killed by the test suite.
Example report screenshot from the Stryker team's HTML reporter article.
Stryker reports several outcomes:
- Killed: a test failed because the mutant changed behaviour.
- Survived: the tests still passed, so the change may have escaped detection.
- No coverage: no test reached the mutated code.
- Compile error or runtime error: the mutation could not be evaluated normally.
- Timeout: the test did not finish within the configured limit.
A survived mutant is a useful investigation target, not automatic proof that the test is bad. Some mutations are equivalent: they do not change observable behaviour for any valid input. Those cannot be killed by adding an assertion.
Source-level report screenshot from the same official Stryker report article.
Install it in a JavaScript or TypeScript project
Prerequisites: Node.js 22+, npm, and a project whose normal test command already works.
The official getting-started guide recommends the interactive initializer:
npm init stryker@latest Choose the test runner that matches your project. StrykerJS has official runners for common JavaScript testing setups, including Vitest, Jest, Mocha, Jasmine, Karma and Tap. The initializer installs the required packages and creates a stryker.config.mjs file.
Run the mutation test:
npx stryker run A focused configuration can look like this after selecting the correct runner in the initializer:
export default { mutate: [ "src/**/*.ts", "!src/**/*.test.ts", "!src/**/*.spec.ts", ], reporters: ["clear-text", "html"], coverageAnalysis: "perTest", }; The mutate patterns should point at production code, not test files. The html reporter creates a browser-readable report. perTest coverage analysis lets Stryker run only the tests that cover a particular mutant, rather than rerunning every test for every change. The official documentation explains the available configuration options.
Watch mutation testing with the Stryker maintainer
This 2022 walkthrough features Stryker maintainer Nico Jansen explaining mutation testing in JavaScript. It predates StrykerJS 10, so use the current documentation for Node.js 22 and the latest runner setup.
How to use the score without gaming it
Do not turn mutation score into another vanity metric. A high score can still coexist with missing requirements, weak integration tests or untested external behaviour.
A practical rollout is:
- Start with a small, deterministic module that has fast unit tests.
- Run Stryker locally and inspect survived mutants.
- Add assertions for meaningful boundary conditions and error paths.
- Exclude generated files and code that cannot be usefully mutated.
- Save the HTML report as a CI artifact or run mutation testing on a schedule.
- Add a score threshold only after you understand the baseline and the cost of the run.
Mutation testing is especially useful for pure business rules, parsers, validators, pricing calculations and permission checks. It is less attractive for slow end-to-end suites that depend on external services. Each mutant can require another test execution, so the cost can grow quickly.
StrykerJS or the newer mutator project?
StrykerJS is the more established choice when you need a broad runner ecosystem, a mature configuration surface, HTML reporting and a long-running project with a documented release history.
The newer mutator project is aimed at Vitest-oriented JavaScript and TypeScript workflows. Its maintainer describes static analysis, cached results and diff-scoped execution as ways to make repeated mutation runs faster during active coding. Those performance claims are maintainer-reported and should be benchmarked on your own codebase.
The choice is not simply "old versus new." If your project uses several test runners or needs a mature integration, start with StrykerJS. If it is a Vitest-only project and the full mutation run is too slow, evaluate mutator on a branch and compare both correctness and runtime.
Limitations and release hygiene
Mutation testing is not a substitute for requirements review, integration testing, property-based testing or security analysis. It checks a specific question: would the tests notice these small source changes? It does not generate every possible bug.
The v10.1.1 release note says it was republished because of a provenance issue in the release process. That does not mean the package is malicious, but it is a reason to verify the exact package source and provenance when upgrading. Pin versions in CI and review the official release notes rather than copying an old install command from a blog post.
StrykerJS is Apache-2.0 licensed. Its main cost is engineering time and test execution, not a per-seat license. The most maintainable use is usually targeted mutation testing on critical, fast-running code.
Sources and further reading
- StrykerJS GitHub repository
- v10.1.1 release and provenance note
- Official getting-started guide
- Configuration reference
- Stryker HTML report screenshots
- FOSDEM talk: Who's testing the tests?
- Community discussion: mutation testing and AI-generated tests
- November 20 GitHub Trending archive
Pick one critical function in your codebase, add a boundary test, run StrykerJS and inspect the first survived mutant. What did it reveal about your current test suite?



