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 and the stryker-api directly yourself.

 npm install --save-dev stryker stryker-api

If you choose to not install the stryker-cli, use ./node_modules/.bin/stryker instead of stryker for the rest of the quickstart.

3 Configure

Run this command the configure stryker.

 stryker init

If you're asked to install stryker, choose yes. Make decisions for the rest of your questions:

  1. Which test runner do you want to use?
  2. Which test framework do you want to use?
  3. Which reporter(s) do you want to use?

Please let us know if your option is missing here.

After the init is done, inspect the stryker.conf.js file. Update the files and mutate properties if appropriate. For more information on what these options mean, take a look at the Stryker readme

4 Let's kill some mutants

Run stryker to mutation test your project

 stryker run

5 What's next?

Having troubles? Try enabling debug logging by adding logLevel: 'debug' to your stryker.conf.js. To also see output of your test runner, use logLevel: 'trace'. You can also have a look at the readme file of stryker for more information about the configuration. Please report any issues you have or let us know via gitter.

Want to help the Stryker community? Awesome! You can help by writing plugins, document issues or simply writing docs. You can always drop us a line on gitter.

Need help?