Skip to main content

Getting started

Install Stryker using npm.


1 Prepare

Make sure you have npm and nodejs installed. Open a terminal / command prompt and cd to the root of your project you want to mutation test.

cd my-project

2 Install

The easiest way to get started with Stryker is by installing the stryker-cli globally. It is a small package which forwards commands to your local Stryker instance.

npm install -g stryker-cli

Optionally, you could also install Stryker directly yourself.

npm install --save-dev @stryker-mutator/core

If you choose to not install the stryker-cli, use npx stryker (after installing @stryker-mutator/core locally) instead of stryker for the rest of the quickstart.

3 Configure

Run this command to configure Stryker.

stryker init

If you're asked to install Stryker, choose Yes. Follow the questionnaire.

Please let us know if your option is missing here by opening an issue.

After the init is done, inspect the stryker.conf.js file.

For more information on what these options mean, take a look at the Configuration docs page

4 Let's kill some mutants

Run Stryker to mutation test your project

stryker run

Have troubles running Stryker? Try running with trace logging.

stryker run --logLevel trace

You can also have a look at the Configuration docs page for more information about the configuration.

Please report any issues you have or let us know via Slack.