Skip to content

feat(@angular-devkit/build-angular): add support for --no-browsers in karma builder #26611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2023
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
2 changes: 1 addition & 1 deletion goldens/public-api/angular_devkit/build_angular/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export interface FileReplacement {
// @public
export interface KarmaBuilderOptions {
assets?: AssetPattern_3[];
browsers?: string;
browsers?: Browsers;
codeCoverage?: boolean;
codeCoverageExclude?: string[];
exclude?: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ export function execute(
karmaOptions.singleRun = singleRun;

// Convert browsers from a string to an array
if (options.browsers) {
if (typeof options.browsers === 'string' && options.browsers) {
karmaOptions.browsers = options.browsers.split(',');
} else if (options.browsers === false) {
karmaOptions.browsers = [];
}

if (options.reporters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,18 @@
"description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
},
"browsers": {
"type": "string",
"description": "Override which browsers tests are run against."
"description": "Override which browsers tests are run against. Set to `false` to not use any browser.",
"oneOf": [
{
"type": "string",
"description": "A comma seperate list of browsers to run tests against."
},
{
"const": false,
"type": "boolean",
"description": "Does use run tests against a browser."
}
]
},
"codeCoverage": {
"type": "boolean",
Expand Down