/
stryker-core.json
425 lines (425 loc) · 16.2 KB
/
stryker-core.json
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "StrykerOptions",
"description": "JSON schema for the Stryker Mutator configuration file",
"type": "object",
"definitions": {
"commandRunnerOptions": {
"title": "CommandRunnerOptions",
"type": "object",
"properties": {
"command": {
"description": "The command to test each mutant. For example \"npm run mocha\". Defaults to \"npm test\".",
"type": "string",
"default": "npm test"
}
}
},
"logLevel": {
"title": "LogLevel",
"type": "string",
"enum": [
"off",
"fatal",
"error",
"warn",
"info",
"debug",
"trace"
],
"tsEnumNames": [
"Off",
"Fatal",
"Error",
"Warning",
"Information",
"Debug",
"Trace"
]
},
"coverageAnalysis": {
"title": "CoverageAnalysis",
"type": "string",
"enum": [
"off",
"all",
"perTest"
]
},
"reportType": {
"title": "ReportType",
"type": "string",
"enum": [
"full",
"mutationScore"
],
"tsEnumNames": [
"Full",
"MutationScore"
]
},
"clearTextReporterOptions": {
"title": "ClearTextReporterOptions",
"type": "object",
"properties": {
"allowColor": {
"description": "Indicates whether or not to use color coding in output.",
"type": "boolean",
"default": true
},
"logTests": {
"description": "Indicates whether or not to log which tests were executed for a given mutant.",
"type": "boolean",
"default": true
},
"maxTestsToLog": {
"description": "Indicates the maximum amount of test to log when `logTests` is enabled",
"type": "integer",
"minimum": 0,
"default": 3
}
}
},
"dashboardOptions": {
"title": "DashboardOptions",
"additionalProperties": false,
"type": "object",
"properties": {
"project": {
"description": "Indicates which project to use if the \"dashboard\" reporter is enabled.",
"type": "string"
},
"version": {
"description": "Indicates which version to use if the \"dashboard\" reporter is enabled.",
"type": "string"
},
"module": {
"description": "Indicates which module to use if the \"dashboard\" reporter is enabled.",
"type": "string"
},
"baseUrl": {
"description": "Indicates the base url of the stryker dashboard.",
"type": "string",
"default": "https://dashboard.stryker-mutator.io/api/reports"
},
"reportType": {
"description": "Indicates wether to send a full report (inc. source code and mutant results) or only the mutation score.",
"$ref": "#/definitions/reportType",
"default": "full"
}
}
},
"eventRecorderOptions": {
"title": "EventRecorderOptions",
"additionalProperties": false,
"type": "object",
"properties": {
"baseDir": {
"description": "The base dir to write the events to",
"type": "string",
"default": "reports/mutation/events"
}
}
},
"htmlReporterOptions": {
"title": "HtmlReporterOptions",
"additionalProperties": false,
"type": "object",
"properties": {
"baseDir": {
"description": "The output folder for the html report.",
"type": "string",
"default": "reports/mutation/html"
}
}
},
"mutationScoreThresholds": {
"title": "MutationScoreThresholds",
"additionalProperties": false,
"type": "object",
"properties": {
"high": {
"$ref": "#/definitions/percentage",
"default": 80
},
"low": {
"$ref": "#/definitions/percentage",
"default": 60
},
"break": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/definitions/percentage"
}
],
"default": null
}
}
},
"percentage": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"mutatorDescriptor": {
"type": "object",
"additionalProperties": false,
"properties": {
"plugins": {
"description": "Override the default babel plugins Stryker uses to parse your JavaScript files. The default list of plugins is extensive and normally doesn't need overriding. Stryker also loads your babel plugins by default (if you have them). If Stryker's default babel plugins conflicts with your plugins, try to override this list with an empty array.",
"anyOf": [
{
"type": "array",
"items": {
"type": [
"string",
"array"
]
}
},
{
"type": "null"
}
],
"default": null
},
"excludedMutations": {
"type": "array",
"items": {
"type": "string"
},
"default": []
}
}
},
"warningOptions": {
"title": "WarningOptions",
"type": "object",
"default": {},
"properties": {
"unknownOptions": {
"description": "decide whether or not to log warnings when additional stryker options are configured",
"type": "boolean",
"default": true
},
"preprocessorErrors": {
"description": "decide whether or not to log warnings when a preprocessor error occurs. For example, when the disabling of type errors fails.",
"type": "boolean",
"default": true
}
}
}
},
"properties": {
"allowConsoleColors": {
"description": "The 'allowConsoleColors' value indicates whether Stryker should use colors in console.",
"type": "boolean",
"default": true
},
"buildCommand": {
"type": "string",
"description": "Configure a build command to run after mutating the code, but before mutants are tested. This is generally used to transpile your code before testing. Only configure this if your test runner doesn't take care of this already and you're not using just-in-time transpiler like `babel/register` or `ts-node`.",
"examples": [
"tsc -b",
"babel src --out-dir lib",
"npm run build"
]
},
"checkers": {
"description": "Enable checker plugins here. A checker plugin will be invoked for each mutant before it is run in a test runner. It can check to see of a given mutant is valid, by for example validate that it won't result in a type error",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"concurrency": {
"description": "Set the concurrency of workers. Stryker will always run checkers and test runners in parallel by creating worker processes (note, not `worker_threads`). This defaults to `n-1` where `n` is the number of logical CPU cores available on your machine, unless `n <= 4`, in that case it uses `n`. This is a sane default for most use cases.",
"type": "number"
},
"maxTestRunnerReuse": {
"description": "Restart each forked threads after <n> runs. Not recommended unless you are experiencing memory leaks that you are unable to resolve. (default: 0)",
"type": "number",
"default": 0
},
"commandRunner": {
"description": "Options used by the command test runner. Note: these options will only be used when the command test runner is activated (this is the default)",
"$ref": "#/definitions/commandRunnerOptions",
"default": {}
},
"coverageAnalysis": {
"$ref": "#/definitions/coverageAnalysis",
"description": "Indicates which coverage analysis strategy to use. During mutation testing, stryker will try to only run the tests that cover a particular line of code.\n\n'perTest': Analyse coverage per test.\n'all': Analyse the coverage for the entire test suite.\n'off' (default): Don't use coverage analysis",
"default": "off"
},
"clearTextReporter": {
"description": "The options for the clear text reporter.",
"$ref": "#/definitions/clearTextReporterOptions",
"default": {}
},
"dashboard": {
"description": "The options for the dashboard reporter.",
"$ref": "#/definitions/dashboardOptions",
"default": {}
},
"eventReporter": {
"description": "The options for the event recorder reporter.",
"$ref": "#/definitions/eventRecorderOptions",
"default": {}
},
"fileLogLevel": {
"description": "Set the log level that Stryker uses to write to the \"stryker.log\" file",
"$ref": "#/definitions/logLevel",
"default": "off"
},
"files": {
"description": "With `files` you can choose which files should be included in your test runner sandbox.\nThis is normally not needed as it defaults to all files not ignored by git.\nTry it out yourself with this command: `git ls-files --others --exclude-standard --cached --exclude .stryker-tmp`.\n\nIf you do need to override `files` (for example: when your project does not live in a git repository),\nyou can override the files here.\n\nWhen using the command line, the list can only contain a comma separated list of globbing expressions.\nWhen using the config file you can provide an array with `string`s",
"type": "array",
"items": {
"type": "string"
}
},
"logLevel": {
"description": "Set the log level that Stryker uses to write to the console.",
"$ref": "#/definitions/logLevel",
"default": "info"
},
"maxConcurrentTestRunners": {
"description": "[DEPRECATED please use \"concurrency\" instead]. Specifies the maximum number of concurrent test runners to spawn. Mutation testing is time consuming. By default, Stryker tries to make the most of your CPU's, by spawning as many test runners as you have CPU cores (`Number.MAX_SAFE_INTEGER`).",
"type": "number",
"default": 9007199254740991
},
"mutate": {
"description": "With mutate you configure the subset of files to use for mutation testing. Generally speaking, these should be your own source files.",
"type": "array",
"items": {
"type": "string"
},
"default": [
"{src,lib}/**/!(*.+(s|S)pec|*.+(t|T)est).+(cjs|mjs|js|ts|jsx|tsx|html|vue)",
"!{src,lib}/**/__tests__/**/*.+(cjs|mjs|js|ts|jsx|tsx|html|vue)"
]
},
"mutator": {
"description": "Configure how Stryker mutates your code.",
"$ref": "#/definitions/mutatorDescriptor",
"default": {}
},
"packageManager": {
"enum": [
"npm",
"yarn"
],
"description": "The package manager Stryker can use to install missing dependencies."
},
"plugins": {
"description": "With 'plugins', you can add additional Node modules for Stryker to load (or require). By default, all node_modules starting with @stryker-mutator/* will be loaded, so you would normally not need to specify this option. These modules should be installed right next to stryker. For a current list of plugins, you can consult 'npm' or 'stryker-mutator.io.'",
"type": "array",
"items": {
"type": "string"
},
"default": [
"@stryker-mutator/*"
]
},
"appendPlugins": {
"description": "A list of additional plugins you want Stryker to load (`require`) without overwriting the (default) `plugins`.",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"reporters": {
"description": "With reporters, you can set the reporters for stryker to use.",
"type": "array",
"items": {
"type": "string"
},
"default": [
"clear-text",
"progress",
"html"
]
},
"htmlReporter": {
"description": "The options for the html reporter",
"$ref": "#/definitions/htmlReporterOptions"
},
"disableTypeChecks": {
"description": "Configure a pattern that matches the files of which type checking has to be disabled. This is needed because Stryker will create (typescript) type errors when inserting the mutants in your code. Stryker disables type checking by inserting `// @ts-nocheck` atop those files and removing other `// @ts-xxx` directives (so they won't interfere with `@ts-nocheck`). The default setting allows these directives to be stripped from all JavaScript and friend files in `lib`, `src` and `test` directories. You can specify a different glob expression or set it to `false` to completely disable this behavior.",
"anyOf": [
{
"enum": [
false
]
},
{
"type": "string"
}
],
"default": "{test,src,lib}/**/*.{js,ts,jsx,tsx,html,vue}"
},
"symlinkNodeModules": {
"description": "The 'symlinkNodeModules' value indicates whether Stryker should create a symbolic link to your current node_modules directory in the sandbox directories. This makes running your tests by Stryker behave more like your would run the tests yourself in your project directory. Only disable this setting if you really know what you are doing.",
"type": "boolean",
"default": true
},
"tempDirName": {
"description": "Choose a different temp dir that Stryker uses for mutation testing. This directory will contain copies of your source code during a mutation test run. It will be created if it not exists and is *entirely deleted* after a successful run, so change this with caution.",
"type": "string",
"default": ".stryker-tmp"
},
"cleanTempDir": {
"description": "Choose whether or not to clean the temp dir (which is \".stryker-tmp\" inside the current working directory by default) after a successful run. The temp dir will never be removed when the run failed for some reason (for debugging purposes)",
"type": "boolean",
"default": true
},
"testRunner": {
"description": "With 'testRunner' you specify the test runner that Stryker uses to run your tests. The default value is command. The command runner runs a configurable bash/cmd command and bases the result on the exit code of that program (0 for success, otherwise failed). You can configure this command via the config file using the 'commandRunner: { command: 'npm run mocha' }'. It uses 'npm test' as the command by default.",
"type": "string",
"default": "command"
},
"thresholds": {
"description": "Specify the thresholds for mutation score.",
"$ref": "#/definitions/mutationScoreThresholds",
"default": {}
},
"timeoutFactor": {
"description": "Configure the allowed timeout deviation relative to the time of a normal test run. Tweak this if you notice that mutants are prone to creating slower code, but not infinite loops (for that, use `timeoutMS`)",
"type": "number",
"default": 1.5
},
"timeoutMS": {
"description": "Configure an absolute timeout deviation. Tweak this if you run Stryker on a busy machine and you need to wait longer to make sure that the code indeed entered an infinite loop.",
"type": "number",
"default": 5000
},
"dryRunTimeoutMinutes": {
"description": "Configure an absolute timeout for the initial test run. (It can take a while, therefore we use minutes as time unit.)",
"type": "number",
"minimum": 0,
"default": 5
},
"tsconfigFile": {
"description": "Configure the (root) tsconfig file for typescript projects. This will allow Stryker to rewrite the `extends` and `references` settings in this and related tsconfig files in your sandbox. Defaults to `tsconfig.json`. This setting is also used when you enable the `@stryker-mutator/typescript-checker plugin",
"type": "string",
"default": "tsconfig.json"
},
"warnings": {
"default": true,
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/warningOptions"
}
],
"description": "Enable or disable certain warnings"
}
}
}