This module provide a stryker runner that allow to run mutation testing only on files diff with default branch.
You will need the following things properly installed on your computer :
This module required @stryker-mutator/core
>=3 on your project to work. Install it and these dependencies like so :
$ npm add @stryker-mutator/core stryker-diff-runner
If you want to use this module with an older version of Stryker, you can install the v1 package :
$ npm add @stryker-mutator/core@2 @stryker-mutator/api@2 stryker-diff-runner@1
Add a NPM script to run Stryker mutation testing through the diff runner
{
// ...
"scripts": {
// ...
"test:mutation:diff": "stryker-diff-runner"
}
}
All stryker command arguments can be passed to the diff runner.
By default stryker-diff-runner
performs a comparison with the master branch and looks for the file stryker.conf.js in the root directory.
To change these settings include the --branch
and --path
commands. Check the example below:
{
// ...
"scripts": {
// ...
"test:mutation:diff": "stryker-diff-runner --path test/stryker.conf.js --branch main"
}
}
In order to contribute and be able to start developing on the project, you will have to follow following steps :
$ git clone <repository>
$ cd <repository>
$ npm install
npm run test
npm run build