@diogovcs/stryker-mutator
v0.2.7
Published
NX plugin for integrating Stryker mutation testing into your NX workspace
Downloads
4,438
Maintainers
Readme
NX Stryker Mutator
Nx plugin for Stryker Mutator integration within a Nx Workspace.
Setup
Npm
npm install -D @diogovcs/stryker-mutatorYarn
yarn add -D @diogovcs/stryker-mutatorPnpm
pnpm add -D @diogovcs/stryker-mutatorAdd to Workspace
nx generate @diogovcs/stryker-mutator:stryker-mutator [APPS_NAME] [...OPTIONS]This command will generate stryker configuration for the projects. This plugin have presets set for node, nestjs and Angular applications. The available options allowed when generating an application are the following:
| name | type | default | description |
|-----------|-----------------------------|---------|----------------------------------------------------------------------------|
| APPS_NAME | string | - | Runs stryker for the projects. Accepts a comma separated list of projects. |
| --preset | angular OR node OR nestjs | - | Sets different project configurations depending on the preset chosen. |
Examples
Generate stryker configurations for multiple projects:
nx generate @diogovcs/stryker-mutator:stryker-mutator my-first-project,my-second-projectMutate
The Mutate executor can take optional parameters as the location of the stryker configuration file. Here it is an example a mutate executor configuration:
{
"mutate": {
"executor": "@diogovcs/stryker-mutator:mutate",
"options": {
"strykerConfig": "apps/my-app/stryker.config.js"
}
}
}Options
| name | type | default | description |
|---------------|-----------|---------|----------------------------------------------------------------------------------------------------------------------|
| mutate | string | - | Specific pattern or file to mutate. (example: src/app.js or src/app.js:5-7). |
| strykerConfig | string | - | Path to the stryker.config.js file. |
| incremental | boolean | false | StrykerJS will track the changes you make to your code and tests and only runs mutation testing on the changed code. |
