This package has been deprecated
Stryker v1 is released, but you're still using an old package. This version is no longer maintained. Please use @stryker-mutator/jest-runner. See https://stryker-mutator.io/blog/2019-02-13/announcing-stryker-1-0 for the full migration guide.
stryker-jest-runner1.4.1 • Public • Published
Install stryker-jest-runner locally within your project folder, like so:
npm i --save-dev stryker-jest-runner
The stryker-jest-runner is a plugin for Stryker to enable Jest as a test runner. As such, you should make sure you have the correct versions of its dependencies installed:
For the minimum supported versions, see the peerDependencies section in package.json.
Make sure you set the
testRunner option to "jest" and set
coverageAnalysis to "off" in your Stryker configuration.
testRunner: 'jest'coverageAnalysis: 'off'
The stryker-jest-runner also provides a couple of configurable options using the
jest property in your Stryker config:
jest:projectType: 'custom'config:enableFindRelatedTests: true
|option||description||default value||alternative values|
|projectType (optional)||The type of project you are working on.||
|config (optional)||A custom Jest configuration object. You could also use
|enableFindRelatedTests (optional)||Whether to run jest with the
Note: When neither of the options are specified it will use the Jest configuration in your "package.json".
projectType option is ignored when the
config option is specified.
Note: Stryker currently only works for CRA-projects that have not been ejected.
The following is an example stryker.conf.js file:
For more information on what these options mean, take a look at the Stryker readme.
Loading the plugin
In order to use the
stryker-jest-runner it must be loaded in the Stryker mutation testing framework via the Stryker configuration. The easiest way to achieve this, is not have a plugins section in your config file. That way, all node_modules starting with
stryker- will be loaded.
Make sure to read the Stryker contribution guidelines located in the Stryker mono repository.