Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/angular/cli/lib/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,13 @@
]
},
"default": []
},
"reporters": {
"type": "array",
"description": "Karma reporters to use. Directly passed to the karma runner.",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
Expand Down
7 changes: 7 additions & 0 deletions packages/angular_devkit/build_angular/src/karma/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
5 changes: 5 additions & 0 deletions packages/angular_devkit/build_angular/src/karma/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
}
7 changes: 7 additions & 0 deletions packages/angular_devkit/build_angular/src/karma/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@
]
},
"default": []
},
"reporters": {
"type": "array",
"description": "Karma reporters to use. Directly passed to the karma runner.",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
Expand Down