@stryker-mutator/mocha-framework
Version:
A plugin to use the mocha test framework in Stryker, the JavaScript mutation testing framework
43 lines (30 loc) • 2.32 kB
Markdown
[](https://dashboard.stryker-mutator.io/reports/github.com/stryker-mutator/stryker/master?module=mocha-framework)
[](https://github.com/stryker-mutator/stryker/actions?query=workflow%3ACI+branch%3Amaster)
[](https://www.npmjs.com/package/@stryker-mutator/mocha-framework)
[](https://img.shields.io/node/v/@stryker-mutator/mocha-framework.svg)
[](https://join.slack.com/t/stryker-mutator/shared_invite/enQtOTUyMTYyNTg1NDQ0LTU4ODNmZDlmN2I3MmEyMTVhYjZlYmJkOThlNTY3NTM1M2QxYmM5YTM3ODQxYmJjY2YyYzllM2RkMmM1NjNjZjM)
# Stryker Mocha Framework
A plugin to speed up [Mocha](http://mochajs.org/) tests in [Stryker](https://stryker-mutator.io), the JavaScript mutation testing framework.
This plugin makes it possible for Stryker to use `coverageAnalysis: 'perTest'`, by providing the abstraction to select which individual test(s) to run. You might also be looking for the [stryker-mocha-runner](https://www.npmjs.com/package/stryker-mocha-runner), which makes it possible to use the node-based Mocha test runner in stryker.
## Install
Install @stryker-mutator/mocha-framework locally within your project folder, like so:
```bash
npm i --save-dev @stryker-mutator/mocha-framework
```
## Peer dependencies
The `@stryker-mutator/mocha-framework` is a plugin to use `mocha` for `stryker` as a test framework.
As such, you should make sure you have the correct versions of its dependencies installed:
* `@stryker-mutator/core`
* `mocha`
## Configuring
You can either configure the mocha test framework using the command line or by providing it in the `stryker.conf.js` file.
This README describes how to use the `stryker.conf.js` (or `stryker.conf.json`) config file:
```javascript
// stryker.conf.js
module.exports = {
// ...
testFramework: 'mocha',
coverageAnalysis: 'perTest'
// ...
}
```