mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 03:23:57 +08:00
feat(@angular-devkit/build-angular): add --reporters option to test
It was a regression, and used by enough people on CI. No reason it should be omitted and karma.conf.js only. Fixes #11376
This commit is contained in:
parent
52b22bf2e4
commit
3fd6afc7f8
packages
angular/cli/lib/config
angular_devkit/build_angular/src/karma
@ -1261,6 +1261,13 @@
|
||||
]
|
||||
},
|
||||
"default": []
|
||||
},
|
||||
"reporters": {
|
||||
"type": "array",
|
||||
"description": "Karma reporters to use. Directly passed to the karma runner.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
@ -71,6 +71,13 @@ export class KarmaBuilder implements Builder<KarmaBuilderSchema> {
|
||||
karmaOptions.browsers = options.browsers.split(',');
|
||||
}
|
||||
|
||||
if (options.reporters) {
|
||||
// Split along commas to make it more natural, and remove empty strings.
|
||||
karmaOptions.reporters = options.reporters
|
||||
.reduce<string[]>((acc, curr) => acc.concat(curr.split(/,/)), [])
|
||||
.filter(x => !!x);
|
||||
}
|
||||
|
||||
const sourceRoot = builderConfig.sourceRoot && resolve(root, builderConfig.sourceRoot);
|
||||
|
||||
karmaOptions.buildWebpack = {
|
||||
|
@ -32,4 +32,9 @@ export interface KarmaBuilderSchema extends Pick<BrowserBuilderSchema,
|
||||
* Globs to exclude from code coverage.
|
||||
*/
|
||||
codeCoverageExclude: string[];
|
||||
|
||||
/**
|
||||
* Karma reporters to use. Directly passed to the karma runner.
|
||||
*/
|
||||
reporters?: string[];
|
||||
}
|
||||
|
@ -150,6 +150,13 @@
|
||||
]
|
||||
},
|
||||
"default": []
|
||||
},
|
||||
"reporters": {
|
||||
"type": "array",
|
||||
"description": "Karma reporters to use. Directly passed to the karma runner.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user