/
AngularPreset.ts
34 lines (29 loc) · 1.25 KB
/
AngularPreset.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as os from 'os';
import { StrykerOptions } from '@stryker-mutator/api/core';
import Preset from './Preset';
import PresetConfiguration from './PresetConfiguration';
const handbookUrl = 'https://github.com/stryker-mutator/stryker-handbook/blob/master/stryker/guides/angular.md#angular';
export class AngularPreset implements Preset {
public readonly name = 'angular-cli';
// Please keep config in sync with handbook
private readonly dependencies = ['@stryker-mutator/karma-runner'];
private readonly config: Partial<StrykerOptions> = {
mutate: ['src/**/*.ts', '!src/**/*.spec.ts', '!src/test.ts', '!src/environments/*.ts'],
testRunner: 'karma',
karma: {
configFile: 'src/karma.conf.js',
projectType: 'angular-cli',
config: {
browsers: ['ChromeHeadless'],
},
},
reporters: ['progress', 'clear-text', 'html'],
concurrency: Math.floor(os.cpus().length / 2),
// eslint-disable-next-line camelcase
concurrency_comment: 'Recommended to use about half of your available cores when running stryker with angular',
coverageAnalysis: 'perTest',
};
public async createConfig(): Promise<PresetConfiguration> {
return { config: this.config, handbookUrl, dependencies: this.dependencies };
}
}