mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 20:52:06 +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
@ -1261,6 +1261,13 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"default": []
|
"default": []
|
||||||
|
},
|
||||||
|
"reporters": {
|
||||||
|
"type": "array",
|
||||||
|
"description": "Karma reporters to use. Directly passed to the karma runner.",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -71,6 +71,13 @@ export class KarmaBuilder implements Builder<KarmaBuilderSchema> {
|
|||||||
karmaOptions.browsers = options.browsers.split(',');
|
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);
|
const sourceRoot = builderConfig.sourceRoot && resolve(root, builderConfig.sourceRoot);
|
||||||
|
|
||||||
karmaOptions.buildWebpack = {
|
karmaOptions.buildWebpack = {
|
||||||
|
@ -32,4 +32,9 @@ export interface KarmaBuilderSchema extends Pick<BrowserBuilderSchema,
|
|||||||
* Globs to exclude from code coverage.
|
* Globs to exclude from code coverage.
|
||||||
*/
|
*/
|
||||||
codeCoverageExclude: string[];
|
codeCoverageExclude: string[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Karma reporters to use. Directly passed to the karma runner.
|
||||||
|
*/
|
||||||
|
reporters?: string[];
|
||||||
}
|
}
|
||||||
|
@ -150,6 +150,13 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"default": []
|
"default": []
|
||||||
|
},
|
||||||
|
"reporters": {
|
||||||
|
"type": "array",
|
||||||
|
"description": "Karma reporters to use. Directly passed to the karma runner.",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user