stryker-js

Measure JavaScript and TypeScript test quality through mutation testing and identify untested defects.

416|6|Updated Apr 24, 2026
Ready to run
npx skills add https://github.com/mizchi/skills --skill stryker-js-mizchi
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: stryker-js
Source: https://github.com/mizchi/skills/tree/main/stryker-js
Command: npx skills add https://github.com/mizchi/skills --skill stryker-js-mizchi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @stryker-mutator/core, @stryker-mutator/vitest-runner, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? This Skill addresses the gap between high test coverage and actual defect detection. A passing test suite with high coverage does not guarantee that tests catch plausible bugs. Mutation testing reveals whether your tests can detect intentional changes to production code, exposing weak assertions and missing edge cases. ## Core Features & Use Cases - Mutation Testing Integration: Introduce StrykerJS to automatically mutate source code and measure how many mutants your tests catch. - CI Diff Analysis: Run mutation testing only on changed source in pull requests to detect gaps in new code without full-suite overhead. - Local Test Review: Inspect surviving mutants locally to identify missing inputs, weak assertions, and untested code paths. - Use Case: A team merges a payment module with 95% code coverage. Mutation testing reveals that boundary conditions (amounts exactly at 5000) are untested; adding focused boundary regressions increases the mutation score from 57% to 100%. ## Quick Start Run mutation testing on the production source in your project to measure how many injected defects your tests detect.

Frequently Asked Questions about stryker-js

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure test quality beyond code coverage?▼

Mutation testing injects defects into production code and checks if tests fail. A high mutation score means tests catch real bugs; survivors reveal weak assertions or missing cases. Coverage alone cannot answer this question.

How does StrykerJS integrate with Vitest and pnpm?▼

Install @stryker-mutator/core and @stryker-mutator/vitest-runner, configure mutate patterns in stryker.config.json, add test scripts to package.json, and run pnpm test:mutation. Stryker reads your vitest config and reports surviving mutants as JSON and HTML.

Can I run mutation testing only on changed code in CI?▼

Yes. Use git diff selection to mutate only modified production source relative to the merge-base, skipping test-only or config-only changes. This reduces CI cost while ensuring new code quality meets thresholds.

What do 'Survived' and 'NoCoverage' mutants mean?▼

Survived means a test suite passed with the mutant injected, indicating a weak assertion or missing input. NoCoverage means no test exercises that code path. Both reveal test gaps; surviving mutants are more actionable.

Why does mutation testing fail with timeouts?▼

Timeouts usually mean a mutated loop or recursion became infinite. Record timeouts separately from killed mutants; they provide evidence of detection but can also indicate infrastructure delays unrelated to assertion strength.

How do I improve tests when mutation reveals gaps?▼

For each survivor, identify a concrete witness input that should distinguish original from mutant. Add focused regression tests or property-based tests using fast-check; confirm the original passes and the mutant fails before rerunning Stryker.