A plugin to use the karma test runner (or @angular/cli's
ng test) in Stryker.
Install @stryker-mutator/karma-runner locally within your project folder, like so:
Bring your own test runner
@stryker-mutator/karma-runner is a plugin for
stryker to enable
karma as a test runner.
However, it does not come packaged with it's own version of
karma, instead it
uses your very own karma version. It can also work with
@angular/cli, see Configuring
Note: karma v2.0.3 has a known issue which makes it impossible to use it with Stryker. please upgrade to 2.0.4 or higher.
You can configure the
@stryker-mutator/karma-runner using the
stryker.conf.json) config file.
Specify which kind of project you're using. This determines which command is used to start karma
"custom": configure @stryker-mutator/karma-runner to use
"angular-cli": configure @stryker-mutator/karma-runner to use
ng test(see configuring for angular-cli).
Specify a 'karma.conf.js' file to be loaded.
Options specified directly in your stryker.conf.js file using
karma.config will overrule options in your karma.conf.js file.
Specify karma configuration options directly. Options specified here will overrule any options in your karma.conf.js file.
Add ng test arguments. For example, specify an alternative project with:
This will run ng test with
ng test --project=my-lib.
Non overridable options
The browser's life cycle is determined by
@stryker-mutator/karma-runner. I.e. these settings cannot be overridden. You configuration settings for these will be ignored.
coverage plugin will also be removed (not needed for mutation testing).
Configure angular cli
Please follow the angular guide.
As Stryker runs karma in its own process, its logging output will be consumed by Stryker.
To see all logging from karma, set the log level to