CheckOps home

Tools directory

S

CheckOps

StrykerJS

StrykerJS is the Apache-2.0 mutation testing framework for JavaScript and TypeScript, part of the Stryker Mutator family (with Stryker.NET and Stryker4s), supporting Jest, Vitest, Mocha, Karma and more.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

StrykerJS is a mutation testing framework for JavaScript and TypeScript. It is part of the Stryker Mutator family, which also includes Stryker.NET for C# and Stryker4s for Scala, sharing concepts, a common HTML report format and the Stryker Dashboard for publishing results. The JavaScript monorepo is licensed Apache-2.0; version 10.1.1 was released on 23 October 2026.

Mutation testing introduces small faults (mutants) into your code, such as replacing > with >=, changing && to ||, emptying a string, removing a block, or flipping a boolean, then runs your tests. If a test fails, the mutant is killed; if the tests still pass, the mutant survived, revealing a gap in your assertions. The percentage of killed mutants is the mutation score, a stronger signal of test quality than line coverage.

Stryker makes this practical for JavaScript through test runner plugins and performance features. It supports Jest, Vitest, Mocha, Karma, Jasmine, Cucumber and TAP-based runners through dedicated plugins, uses per-test coverage analysis so only relevant tests run for each mutant, can use mutant schemata (compiling all mutants into the code once and switching them at run time), and supports incremental mode, which reuses previous results and only tests changed code.

The README’s quickstart is npx stryker run for small projects, and npm init stryker (via the website quickstart) guides configuration for larger ones. Results appear in a clear HTML report showing each mutant in context, and can be uploaded to the Stryker Dashboard for badges and history.

How it compares: PIT is the equivalent for the JVM, mutmut and cosmic-ray for Python, Infection for PHP and cargo-mutants for Rust. Within JavaScript, Stryker is the established choice, with TypeScript support, checker plugins (for example a TypeScript checker that discards mutants that do not compile) and integrations for front-end frameworks.

In the quality loop, Stryker strengthens unit tests during development and can act as a release gate through break thresholds, typically on critical packages rather than an entire monorepo.

The source code is at stryker-mutator/stryker-js on GitHub under the Apache-2.0 licence, with about 3,400 stars; the most recent commit was on 30 October 2026.

For small projects the README suggests simply adding @stryker-mutator/core and running npx stryker run; by default it uses npm test as the test command and looks for files to mutate in the lib and src directories. All official StrykerJS packages, including runners and checkers, are maintained in a single monorepo.

Features

  1. Rich mutators: Arithmetic, equality, logical, conditional, string, array, regex, optional chaining and more.
  2. Test runner plugins: Jest, Vitest, Mocha, Karma, Jasmine, Cucumber and TAP-based runners.
  3. Per-test coverage: Runs only the tests that cover each mutant.
  4. Mutant schemata: Compiles mutants into the code once for speed.
  5. Incremental mode: Reuses previous results and re-tests only what changed.
  6. TypeScript checker: Discards mutants that cause type errors, saving time and noise.
  7. HTML report and dashboard: Interactive reports and optional publishing to the Stryker Dashboard.
  8. Thresholds: high, low and break thresholds to warn or fail builds.

Pros

  1. Makes test quality visible: Surviving mutants show exactly which lines lack meaningful assertions.
  2. Shared family: Similar experience across JavaScript, .NET and Scala.
  3. Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
  4. Actively maintained: The repository had commits as recent as 30 October 2026.
  5. Community: About 3,400 GitHub stars.

Cons

  1. Run time: Even with optimisations, large codebases take a long time; scope runs carefully.
  2. Equivalent mutants: Some survivors cannot be killed because they do not change behaviour.
  3. Configuration: Bundlers, monorepos and unusual test setups can need tuning.
  4. Score pressure: Chasing 100% can waste effort; focus on meaningful survivors.

Initialise Stryker in an existing project (follow the prompts to pick your test runner):

npm init stryker
npx stryker run

A minimal stryker.config.json for Vitest:

{
  "testRunner": "vitest",
  "mutate": ["src/**/*.ts", "!src/**/*.test.ts"],
  "reporters": ["html", "clear-text", "progress"],
  "incremental": true,
  "thresholds": { "high": 80, "low": 60, "break": 50 }
}

Open reports/mutation/mutation.html to inspect survivors. In CI, run incremental mode on pull requests and full runs nightly.

Practical tips:

  1. Start with one package or folder in mutate, then expand.
  2. Add the TypeScript checker for TypeScript projects.
  3. Treat each surviving mutant as a question: is there a missing test, or is the mutant equivalent?

Resources:

Pricing

StrykerJS is free and open source under the Apache-2.0 licence.

  1. JavaScript and TypeScript teams who want to measure test effectiveness.
  2. Library maintainers with high coverage who suspect weak assertions.
  3. Teams protecting critical logic such as pricing, permissions or validation.
  4. Not a fit as a per-commit gate across a huge monorepo without scoping or incremental mode.

Conclusion

StrykerJS is the leading mutation testing tool for JavaScript and TypeScript, with broad runner support and serious performance optimisations.

Used thoughtfully, on the code that matters most, it turns ‘we have coverage’ into ‘our tests would catch this bug’.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with StrykerJS side by side.