stryker-diff-runner

An utility script that runs Stryker mutation testing on files diff between current git working branch and default one.

Usage no npm install needed!

<script type="module">
  import strykerDiffRunner from 'https://cdn.skypack.dev/stryker-diff-runner';
</script>

README

Stryker diff runner

This module provide a stryker runner that allow to run mutation testing only on files diff with default branch.

Build Status Coverage Status Known Vulnerabilities

Getting started

Prerequisites

You will need the following things properly installed on your computer :

Installation

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

Usage

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.

Custom commands

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"
    }
}

Development

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

Running tests

  • npm run test

Building

  • npm run build

Contacts

Thomas VERHOKEN https://twitter.com/tverhoken