UNPKG

24.8 kBJSONView Raw
1{
2 "$schema": "http://json-schema.org/draft-07/schema#",
3 "title": "StrykerMonoSchema",
4 "description": "Options for Stryker for JS and TypeScript and all officially supported plugins.",
5 "type": "object",
6 "properties": {
7 "allowConsoleColors": {
8 "description": "The 'allowConsoleColors' value indicates whether Stryker should use colors in console.",
9 "type": "boolean",
10 "default": true
11 },
12 "coverageAnalysis": {
13 "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",
14 "type": "string",
15 "enum": [
16 "off",
17 "all",
18 "perTest"
19 ],
20 "default": "off"
21 },
22 "clearTextReporter": {
23 "description": "The options for the clear text reporter.",
24 "$ref": "#/definitions/clearTextReporterOptions",
25 "default": {}
26 },
27 "dashboard": {
28 "description": "The options for the dashboard reporter.",
29 "$ref": "#/definitions/dashboardOptions",
30 "default": {}
31 },
32 "eventReporter": {
33 "description": "The options for the event recorder reporter.",
34 "$ref": "#/definitions/eventRecorderOptions",
35 "default": {}
36 },
37 "fileLogLevel": {
38 "description": "Set the log level that Stryker uses to write to the \"stryker.log\" file",
39 "$ref": "#/definitions/logLevel",
40 "default": "off"
41 },
42 "files": {
43 "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",
44 "type": "array",
45 "items": {
46 "type": "string"
47 }
48 },
49 "logLevel": {
50 "description": "Set the log level that Stryker uses to write to the console.",
51 "$ref": "#/definitions/logLevel",
52 "default": "info"
53 },
54 "maxConcurrentTestRunners": {
55 "description": "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`).",
56 "type": "number",
57 "default": 9007199254740991
58 },
59 "mutate": {
60 "description": "With mutate you configure the subset of files to use for mutation testing. Generally speaking, these should be your own source files.",
61 "type": "array",
62 "items": {
63 "type": "string"
64 },
65 "default": [
66 "{src,lib}/**/*.js?(x)",
67 "!{src,lib}/**/__tests__/**/*.js?(x)",
68 "!{src,lib}/**/?(*.)+(spec|test).js?(x)",
69 "!{src,lib}/**/*+(Spec|Test).js?(x)"
70 ]
71 },
72 "mutator": {
73 "description": "With mutator you configure which mutator plugin you want to use, and optionally, which mutation types to exclude from the test run.",
74 "oneOf": [
75 {
76 "type": "string"
77 },
78 {
79 "$ref": "#/definitions/mutatorDescriptor"
80 }
81 ],
82 "default": "javascript",
83 "errorMessage": "should be an \"object\" describing the mutator or a \"string\". See https://github.com/stryker-mutator/stryker/tree/master/packages/core#mutator."
84 },
85 "packageManager": {
86 "enum": [
87 "npm",
88 "yarn"
89 ],
90 "description": "The package manager Stryker can use to install missing dependencies."
91 },
92 "plugins": {
93 "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.'",
94 "type": "array",
95 "items": {
96 "type": "string"
97 },
98 "default": [
99 "@stryker-mutator/*"
100 ]
101 },
102 "reporters": {
103 "description": "With reporters, you can set the reporters for stryker to use.",
104 "type": "array",
105 "items": {
106 "type": "string"
107 },
108 "default": [
109 "clear-text",
110 "progress",
111 "html"
112 ]
113 },
114 "htmlReporter": {
115 "description": "The options for the html reporter",
116 "$ref": "#/definitions/htmlReporterOptions"
117 },
118 "symlinkNodeModules": {
119 "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.",
120 "type": "boolean",
121 "default": true
122 },
123 "tempDirName": {
124 "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.",
125 "type": "string",
126 "default": ".stryker-tmp"
127 },
128 "testFramework": {
129 "description": "Configure which test framework you are using. This option is not mandatory, as Stryker is test framework agnostic (it doesn't care what framework you use), However, it is required when coverageAnalysis is set to 'perTest', because Stryker needs to hook into the test framework in order to measure code coverage results per test and filter tests to run.",
130 "type": "string"
131 },
132 "testRunner": {
133 "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.",
134 "type": "string",
135 "default": "command"
136 },
137 "thresholds": {
138 "description": "Specify the thresholds for mutation score.",
139 "$ref": "#/definitions/mutationScoreThresholds",
140 "default": {}
141 },
142 "timeoutFactor": {
143 "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`)",
144 "type": "number",
145 "default": 1.5
146 },
147 "timeoutMS": {
148 "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.",
149 "type": "number",
150 "default": 5000
151 },
152 "transpilers": {
153 "description": "Configure which transpiler plugins should transpile the code before it's executed. This is an array where the transpilers are called in the other of the array. This defaults to an empty array meaning no transpilation will be done.",
154 "type": "array",
155 "items": {
156 "type": "string"
157 },
158 "default": []
159 },
160 "warnings": {
161 "default": true,
162 "oneOf": [
163 {
164 "type": "boolean"
165 },
166 {
167 "$ref": "#/definitions/warningOptions"
168 }
169 ],
170 "description": "Enable or disable certain warnings"
171 },
172 "babel": {
173 "description": "Configuration for @stryker-mutator/babel-transpiler",
174 "title": "StrykerBabelConfig",
175 "default": {},
176 "type": "object",
177 "additionalProperties": false,
178 "properties": {
179 "extensions": {
180 "description": "Load additional extensions here. By default only these extensions get picked up by babel: `\".js\", \".jsx\", \".es6\", \".es\", \".mjs\"`.\nFor example: if you want to enable typescript transpilation, set extensions to `[\"ts\", \"tsx\"]`.",
181 "type": "array",
182 "default": [],
183 "items": {
184 "type": "string"
185 }
186 },
187 "optionsFile": {
188 "description": "The location of your babelrc file. Set this value to `null` to disable loading of a babel config file.",
189 "default": ".babelrc",
190 "type": [
191 "string",
192 "null"
193 ]
194 },
195 "options": {
196 "description": "Override babel options from your config file here. Please see [babel's documentation](https://babeljs.io/docs/en/options) to see what is available.\n\nSome options are restricted to be set, because the @stryker-mutator/babel-transpiler takes control of it. These options are: `filename`, `filenameRelative` and `cwd`.",
197 "$ref": "http://json.schemastore.org/babelrc",
198 "type": "object"
199 }
200 }
201 },
202 "jasmineConfigFile": {
203 "description": "Specify your [jasmine configuration file](https://jasmine.github.io/setup/nodejs.html#configuration) to be loaded. Leaving this blank will result in the jasmine defaults, which are undocumented (see [source code here](https://github.com/jasmine/jasmine-npm/blob/master/lib/jasmine.js#L10-L38)).",
204 "type": "string"
205 },
206 "jest": {
207 "title": "JestOptions",
208 "description": "Configuration for @stryker-mutator/jest-runner",
209 "type": "object",
210 "default": {},
211 "properties": {
212 "projectType": {
213 "$ref": "#/definitions/jestProjectType",
214 "default": "custom"
215 },
216 "configFile": {
217 "description": "Path to your Jest config file. Please leave it empty if you want jest configuration to be loaded from package.json or a standard jest configuration file.",
218 "type": "string"
219 },
220 "config": {
221 "description": "A custom Jest configuration object. You could also use `require` to load it here.",
222 "type": "object"
223 },
224 "enableFindRelatedTests": {
225 "description": "Whether to run jest with the `--findRelatedTests` flag. When `true`, Jest will only run tests related to the mutated file per test. (See [_--findRelatedTests_](https://jestjs.io/docs/en/cli.html#findrelatedtests-spaceseparatedlistofsourcefiles)",
226 "type": "boolean",
227 "default": true
228 }
229 },
230 "additionalProperties": false
231 },
232 "karma": {
233 "description": "Configuration for @stryker-mutator/karma-runner",
234 "title": "StrykerKarmaSetup",
235 "additionalProperties": false,
236 "type": "object",
237 "default": {},
238 "properties": {
239 "projectType": {
240 "$ref": "#/definitions/karmaProjectKind",
241 "default": "custom"
242 },
243 "configFile": {
244 "description": "Specify a ['karma.conf.js' file](http://karma-runner.github.io/2.0/config/configuration-file.html) to be loaded. Options specified directly in your stryker.conf.js file using `karma.config` will overrule options in your karma.conf.js file.",
245 "type": "string"
246 },
247 "config": {
248 "description": "Specify [karma configuration options](http://karma-runner.github.io/2.0/config/configuration-file.html) directly. Options specified here will overrule any options in your karma.conf.js file.",
249 "type": "object"
250 },
251 "ngConfig": {
252 "$ref": "#/definitions/karmaNgConfigOptions"
253 }
254 }
255 },
256 "mochaOptions": {
257 "title": "MochaOptions",
258 "additionalProperties": false,
259 "type": "object",
260 "description": "Configuration for @stryker-mutator/mocha-runner",
261 "default": {},
262 "properties": {
263 "require": {
264 "description": "Set mocha's [`require` option](https://mochajs.org/#-r---require-module-name)",
265 "type": "array",
266 "items": {
267 "type": "string"
268 }
269 },
270 "ignore": {
271 "description": "Set mocha's [`ignore option](https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml#L26)",
272 "type": "array",
273 "items": {
274 "type": "string"
275 }
276 },
277 "file": {
278 "description": "Set mocha's [`file options`](https://mochajs.org/#-file-filedirectoryglob)",
279 "type": "array",
280 "items": {
281 "type": "string"
282 }
283 },
284 "opts": {
285 "description": "Specify a ['mocha.opts' file](https://mochajs.org/#mochaopts) to be loaded. Options specified directly in your stryker.conf.js file will overrule options from the 'mocha.opts' file. Disable loading of an additional mocha.opts file with `false`. The only supported mocha options are used: `--ui`, `--require`, `--async-only`, `--timeout`, `--grep` (or their short form counterparts). Others are ignored by the @stryker-mutator/mocha-runner.",
286 "type": "string"
287 },
288 "config": {
289 "description": "Explicit path to the [mocha config file](https://mochajs.org/#-config-path)",
290 "type": "string"
291 },
292 "package": {
293 "description": "Specify an explicit path to a package.json file (ostensibly containing configuration in a mocha property). See https://mochajs.org/#-package-path.",
294 "type": "string"
295 },
296 "no-package": {
297 "type": "boolean",
298 "description": "Explicit turn off [mocha package file](https://mochajs.org/#-package-path)"
299 },
300 "no-opts": {
301 "type": "boolean",
302 "description": "Explicit turn off [mocha opts file](https://mochajs.org/#-opts-path)"
303 },
304 "no-config": {
305 "type": "boolean",
306 "description": "Explicit turn off [mocha config file](https://mochajs.org/#-config-path)"
307 },
308 "timeout": {
309 "description": "Set mocha's [`timeout` option](https://mochajs.org/#-t---timeout-ms)",
310 "type": "number"
311 },
312 "async-only": {
313 "description": "Set mocha's [`async-only` option](https://mochajs.org/#-async-only-a)",
314 "type": "boolean"
315 },
316 "ui": {
317 "description": "Set the name of your [mocha ui](https://mochajs.org/#-u---ui-name)",
318 "type": "string"
319 },
320 "files": {
321 "description": "DEPRECATED, use `spec` instead.",
322 "oneOf": [
323 {
324 "type": "string"
325 },
326 {
327 "type": "array",
328 "items": {
329 "type": "string"
330 }
331 }
332 ]
333 },
334 "spec": {
335 "description": "Choose which files to include. This is comparable to [mocha's test directory](https://mochajs.org/#the-test-directory) although there is no support for `--recursive`.\n\nIf you want to load all files recursively: use a globbing expression (`'test/**/*.js'`). If you want to decide on the order of files, use multiple globbing expressions. For example: use `['test/helpers/**/*.js', 'test/unit/**/*.js']` if you want to make sure your helpers are loaded before your unit tests.",
336 "type": "array",
337 "items": {
338 "type": "string"
339 }
340 },
341 "grep": {
342 "description": "Specify a mocha [`grep`](https://mochajs.org/#grep) command, to single out individual tests.",
343 "type": "string"
344 },
345 "extension": {
346 "description": "Specify mocha [--extension](https://mochajs.org/#-extension-ext) property.",
347 "type": "array",
348 "items": {
349 "type": "string"
350 }
351 }
352 }
353 },
354 "tsconfigFile": {
355 "description": "Location of your tsconfig.json file",
356 "type": "string"
357 },
358 "tsconfig": {
359 "description": "Override tsconfig from your tsconfig.json file",
360 "type": "object",
361 "$ref": "http://json.schemastore.org/tsconfig#/definitions/compilerOptionsDefinition/properties/compilerOptions"
362 },
363 "wct": {
364 "description": "Configuration for the @stryker-mutator/wct-runner. For more information about the available wct options, please see [wct's config.ts file](https://github.com/Polymer/tools/blob/master/packages/web-component-tester/runner/config.ts#L36).",
365 "type": "object",
366 "properties": {
367 "configFile": {
368 "description": "Location of the 'wct.conf.json' file.",
369 "type": "string"
370 },
371 "verbose": {
372 "description": "Enable/disable verbose WCT logging. WCT can be noisy. By default, Stryker will swallow any wct log messages. Enabling this option will forward any wct log messages to Stryker logging. Don't forget to set `logLevel` (or `fileLogLevel`) to `'debug'` in your Stryker configuration to get the most logging out of WCT.",
373 "type": "boolean",
374 "default": false
375 },
376 "npm": {
377 "description": "Use WCT with the `--npm` flag. This will allow web-components installed via npm, instead of bower.",
378 "type": "boolean",
379 "default": false
380 }
381 }
382 },
383 "webpack": {
384 "title": "WebpackOptions",
385 "description": "Configuration for @stryker-mutator/webpack-transpiler",
386 "type": "object",
387 "additionalProperties": false,
388 "default": {},
389 "properties": {
390 "configFile": {
391 "description": "Location of your webpack config file",
392 "type": "string"
393 },
394 "context": {
395 "description": "The [webpack context](https://webpack.js.org/configuration/entry-context/#context)",
396 "type": "string"
397 },
398 "silent": {
399 "description": "Specify to remove the \"ProgressPlugin\" from your webpack config file (making the process silent)",
400 "type": "boolean",
401 "default": true
402 }
403 }
404 }
405 },
406 "definitions": {
407 "logLevel": {
408 "title": "LogLevel",
409 "type": "string",
410 "enum": [
411 "off",
412 "fatal",
413 "error",
414 "warn",
415 "info",
416 "debug",
417 "trace"
418 ],
419 "tsEnumNames": [
420 "Off",
421 "Fatal",
422 "Error",
423 "Warning",
424 "Information",
425 "Debug",
426 "Trace"
427 ]
428 },
429 "reportType": {
430 "title": "ReportType",
431 "type": "string",
432 "enum": [
433 "full",
434 "mutationScore"
435 ],
436 "tsEnumNames": [
437 "Full",
438 "MutationScore"
439 ]
440 },
441 "clearTextReporterOptions": {
442 "title": "ClearTextReporterOptions",
443 "type": "object",
444 "properties": {
445 "allowColor": {
446 "description": "Indicates whether or not to use color coding in output.",
447 "type": "boolean",
448 "default": true
449 },
450 "logTests": {
451 "description": "Indicates whether or not to log which tests were executed for a given mutant.",
452 "type": "boolean",
453 "default": true
454 },
455 "maxTestsToLog": {
456 "description": "Indicates the maximum amount of test to log when `logTests` is enabled",
457 "type": "integer",
458 "minimum": 0,
459 "default": 3
460 }
461 }
462 },
463 "dashboardOptions": {
464 "title": "DashboardOptions",
465 "additionalProperties": false,
466 "type": "object",
467 "properties": {
468 "project": {
469 "description": "Indicates which project to use if the \"dashboard\" reporter is enabled.",
470 "type": "string"
471 },
472 "version": {
473 "description": "Indicates which version to use if the \"dashboard\" reporter is enabled.",
474 "type": "string"
475 },
476 "module": {
477 "description": "Indicates which module to use if the \"dashboard\" reporter is enabled.",
478 "type": "string"
479 },
480 "baseUrl": {
481 "description": "Indicates the base url of the stryker dashboard.",
482 "type": "string",
483 "default": "https://dashboard.stryker-mutator.io/api/reports"
484 },
485 "reportType": {
486 "description": "Indicates wether to send a full report (inc. source code and mutant results) or only the mutation score.",
487 "$ref": "#/definitions/reportType",
488 "default": "full"
489 }
490 }
491 },
492 "eventRecorderOptions": {
493 "title": "EventRecorderOptions",
494 "additionalProperties": false,
495 "type": "object",
496 "properties": {
497 "baseDir": {
498 "description": "The base dir to write the events to",
499 "type": "string",
500 "default": "reports/mutation/events"
501 }
502 }
503 },
504 "htmlReporterOptions": {
505 "title": "HtmlReporterOptions",
506 "additionalProperties": false,
507 "type": "object",
508 "properties": {
509 "baseDir": {
510 "description": "The output folder for the html report.",
511 "type": "string",
512 "default": "reports/mutation/html"
513 }
514 }
515 },
516 "mutationScoreThresholds": {
517 "title": "MutationScoreThresholds",
518 "additionalProperties": false,
519 "type": "object",
520 "properties": {
521 "high": {
522 "$ref": "#/definitions/percentage",
523 "default": 80
524 },
525 "low": {
526 "$ref": "#/definitions/percentage",
527 "default": 60
528 },
529 "break": {
530 "oneOf": [
531 {
532 "type": "null"
533 },
534 {
535 "$ref": "#/definitions/percentage"
536 }
537 ],
538 "default": null
539 }
540 }
541 },
542 "percentage": {
543 "type": "number",
544 "minimum": 0,
545 "maximum": 100
546 },
547 "mutatorDescriptor": {
548 "type": "object",
549 "additionalProperties": false,
550 "properties": {
551 "name": {
552 "type": "string",
553 "default": "javascript"
554 },
555 "plugins": {
556 "anyOf": [
557 {
558 "type": "array",
559 "items": {
560 "type": [
561 "string",
562 "array"
563 ]
564 }
565 },
566 {
567 "type": "null"
568 }
569 ],
570 "default": null
571 },
572 "excludedMutations": {
573 "type": "array",
574 "items": {
575 "type": "string"
576 },
577 "default": []
578 }
579 },
580 "required": [
581 "name"
582 ]
583 },
584 "warningOptions": {
585 "title": "WarningOptions",
586 "type": "object",
587 "default": {},
588 "properties": {
589 "unknownOptions": {
590 "description": "decide whether or not to log warnings when additional stryker options are configured",
591 "type": "boolean",
592 "default": true
593 }
594 }
595 },
596 "jestProjectType": {
597 "description": "The type of project you are working on. \n* `custom` uses the `config` option. \n*`create-react-app` when you are using [create-react-app](https://github.com/facebook/create-react-app)\n* `create-react-app-ts` when you are using [create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript)\n* `react`: DEPRECATED, please use `create-react-app`.",
598 "enum": [
599 "create-react-app",
600 "create-react-app-ts",
601 "react",
602 "react-ts",
603 "custom"
604 ]
605 },
606 "karmaProjectKind": {
607 "title": "ProjectKind",
608 "description": "Specify which kind of project you're using. This determines which command is used to start karma\n* `custom`: configure @stryker-mutator/karma-runner to use `karma start`\n* `angular-cli`: configure @stryker-mutator/karma-runner to use `ng test`",
609 "enum": [
610 "custom",
611 "angular-cli"
612 ]
613 },
614 "karmaNgConfigOptions": {
615 "title": "NgConfigOptions",
616 "type": "object",
617 "additionalProperties": false,
618 "properties": {
619 "testArguments": {
620 "description": "Add [ng test arguments](https://github.com/angular/angular-cli/wiki/test#options). For example, specify an alternative project with: `\"testArguments\": { \"project\": \"my-lib\" }",
621 "title": "NgTestArguments",
622 "type": "object",
623 "additionalProperties": {
624 "type": "string"
625 }
626 }
627 }
628 }
629 }
630}
\No newline at end of file