stryker-jest-runner

A plugin to use the jest test runner and framework in Stryker, the JavaScript mutation testing framework

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.
Last updated 2 years ago by strykermutator-npa .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stryker-jest-runner 
SYNC missed versions from official npm registry.

Build Status Gitter Mutation testing badge

Stryker

Stryker-jest-runner

Installation

Install stryker-jest-runner locally within your project folder, like so:

npm i --save-dev stryker-jest-runner

Peer dependencies

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:

  • jest
  • stryker-api

For the minimum supported versions, see the peerDependencies section in package.json.

Configuration

Configuring Stryker

Make sure you set the testRunner option to "jest" and set coverageAnalysis to "off" in your Stryker configuration.

{
    testRunner: 'jest'
    coverageAnalysis: 'off'
}

Configuring Jest

The stryker-jest-runner also provides a couple of configurable options using the jest property in your Stryker config:

{
    jest: {
        projectType: 'custom',
        config: require('path/to/your/custom/jestConfig.js'),
        enableFindRelatedTests: true,
    }
}
option description default value alternative values
projectType (optional) The type of project you are working on. default default uses the config option (see below)
react when you are using create-react-app
react-ts when you are using create-react-app-typescript
config (optional) A custom Jest configuration object. You could also use require to load it here) undefined
enableFindRelatedTests (optional) Whether to run jest with the --findRelatedTests flag. When true, Jest will only run tests related to the mutated file per test. (See --findRelatedTests) true false

Note: When neither of the options are specified it will use the Jest configuration in your "package.json".
Note: the 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:

module.exports = function(config) {
  config.set({
    testRunner: "jest",
    mutator: "javascript",
    coverageAnalysis: "off",
    mutate: ["src/**/*.js"]
  });
};

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.

Contributing

Make sure to read the Stryker contribution guidelines located in the Stryker mono repository.

Current Tags

  • 1.4.1                                ...           latest (2 years ago)

37 Versions

  • 1.4.1 [deprecated]           ...           2 years ago
  • 1.4.0 [deprecated]           ...           2 years ago
  • 1.3.0 [deprecated]           ...           2 years ago
  • 1.2.10 [deprecated]           ...           2 years ago
  • 1.2.9 [deprecated]           ...           2 years ago
  • 1.2.8 [deprecated]           ...           2 years ago
  • 1.2.7 [deprecated]           ...           2 years ago
  • 1.2.6 [deprecated]           ...           2 years ago
  • 1.2.5 [deprecated]           ...           2 years ago
  • 1.2.4 [deprecated]           ...           2 years ago
  • 1.2.3 [deprecated]           ...           2 years ago
  • 1.2.2 [deprecated]           ...           2 years ago
  • 1.2.1 [deprecated]           ...           2 years ago
  • 1.2.0 [deprecated]           ...           2 years ago
  • 1.1.1 [deprecated]           ...           2 years ago
  • 1.1.0 [deprecated]           ...           2 years ago
  • 1.0.4 [deprecated]           ...           2 years ago
  • 1.0.3 [deprecated]           ...           2 years ago
  • 1.0.2 [deprecated]           ...           2 years ago
  • 1.0.1 [deprecated]           ...           2 years ago
  • 1.0.0 [deprecated]           ...           2 years ago
  • 0.7.0 [deprecated]           ...           2 years ago
  • 0.6.0 [deprecated]           ...           2 years ago
  • 0.5.1 [deprecated]           ...           3 years ago
  • 0.5.0 [deprecated]           ...           3 years ago
  • 0.4.2 [deprecated]           ...           3 years ago
  • 0.4.1 [deprecated]           ...           3 years ago
  • 0.4.0 [deprecated]           ...           3 years ago
  • 0.3.0 [deprecated]           ...           3 years ago
  • 0.2.2 [deprecated]           ...           3 years ago
  • 0.2.1 [deprecated]           ...           3 years ago
  • 0.2.0 [deprecated]           ...           3 years ago
  • 0.1.0 [deprecated]           ...           3 years ago
  • 0.0.6 [deprecated]           ...           4 years ago
  • 0.0.5 [deprecated]           ...           4 years ago
  • 0.0.4 [deprecated]           ...           4 years ago
  • 0.0.3 [deprecated]           ...           4 years ago
Downloads
Today 0
This Week 0
This Month 42
Last Day 0
Last Week 37
Last Month 39
Dependencies (2)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |