Although a config file is not mandatory, it is recommended. You can define your Stryker configuration in either a
.json file. If you use a
.js file, it should contain a NodeJS module that exports the configuration object. Autocompletion is supported using JSON schema or using
@type JS docs.
See configuration for a list of available options.
You can use your editor's autocompletion to help you author your configuration file.
By default, Stryker will look for a "stryker.conf.js" or "stryker.conf.json" file in the current working directory (cwd). You can also use a different configuration file with a second argument to the
Some options allow for a glob pattern to be defined. These glob patterns are defined relative to the cwd.
For example, using
"mutate": [ "src/components/**/*.component.js" ] will make sure only files ending with ".component.js" in the "src/components" directory are mutated.
We suggest using https://globster.xyz/ when auditing more complex glob expressions; it can help you get them just right.
The following is an example
stryker.conf.json file. It specifies running mocha tests with the mocha test runner.