Skip to content

Commit 0108ba9

Browse files
author
Angular Builds
committed
3ee2163 fix(@angular-devkit/build-angular): clear context in Karma by default for single run executions
1 parent 9c8c8b8 commit 0108ba9

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "@angular-devkit/build-angular",
3-
"version": "19.0.0-next.2+sha-7f570c5",
3+
"version": "19.0.0-next.2+sha-3ee2163",
44
"description": "Angular Webpack Build Facade",
55
"main": "src/index.js",
66
"typings": "src/index.d.ts",
77
"builders": "builders.json",
88
"dependencies": {
99
"@ampproject/remapping": "2.3.0",
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7f570c5",
11-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#7f570c5",
12-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#7f570c5",
13-
"@angular/build": "github:angular/angular-build-builds#7f570c5",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3ee2163",
11+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#3ee2163",
12+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#3ee2163",
13+
"@angular/build": "github:angular/angular-build-builds#3ee2163",
1414
"@babel/core": "7.25.2",
1515
"@babel/generator": "7.25.5",
1616
"@babel/helper-annotate-as-pure": "7.24.7",
@@ -21,7 +21,7 @@
2121
"@babel/preset-env": "7.25.4",
2222
"@babel/runtime": "7.25.4",
2323
"@discoveryjs/json-ext": "0.6.1",
24-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#7f570c5",
24+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#3ee2163",
2525
"@vitejs/plugin-basic-ssl": "1.1.0",
2626
"ansi-colors": "4.1.3",
2727
"autoprefixer": "10.4.20",
@@ -77,7 +77,7 @@
7777
"@angular/localize": "^19.0.0-next.0",
7878
"@angular/platform-server": "^19.0.0-next.0",
7979
"@angular/service-worker": "^19.0.0-next.0",
80-
"@angular/ssr": "github:angular/angular-ssr-builds#7f570c5",
80+
"@angular/ssr": "github:angular/angular-ssr-builds#3ee2163",
8181
"@web/test-runner": "^0.18.0",
8282
"browser-sync": "^3.0.2",
8383
"jest": "^29.5.0",
@@ -98,7 +98,7 @@
9898
"@angular/service-worker": {
9999
"optional": true
100100
},
101-
"@angular/ssr": "github:angular/angular-ssr-builds#7f570c5",
101+
"@angular/ssr": "github:angular/angular-ssr-builds#3ee2163",
102102
"@web/test-runner": {
103103
"optional": true
104104
},

src/builders/karma/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ function execute(options, context, transforms = {}) {
8888
? {}
8989
: getBuiltInKarmaConfig(context.workspaceRoot, projectName);
9090
karmaOptions.singleRun = singleRun;
91+
// Workaround https://github.com/angular/angular-cli/issues/28271, by clearing context by default
92+
// for single run executions. Not clearing context for multi-run (watched) builds allows the
93+
// Jasmine Spec Runner to be visible in the browser after test execution.
94+
karmaOptions.client ??= {};
95+
karmaOptions.client.clearContext ??= singleRun ?? false; // `singleRun` defaults to `false` per Karma docs.
9196
// Convert browsers from a string to an array
9297
if (typeof options.browsers === 'string' && options.browsers) {
9398
karmaOptions.browsers = options.browsers.split(',');
@@ -169,9 +174,6 @@ function getBuiltInKarmaConfig(workspaceRoot, projectName) {
169174
'karma-coverage',
170175
'@angular-devkit/build-angular/plugins/karma',
171176
].map((p) => workspaceRootRequire(p)),
172-
client: {
173-
clearContext: false, // leave Jasmine Spec Runner output visible in browser
174-
},
175177
jasmineHtmlReporter: {
176178
suppressAll: true, // removes the duplicated traces
177179
},

src/utils/normalize-cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
1010
exports.normalizeCacheOptions = normalizeCacheOptions;
1111
const node_path_1 = require("node:path");
1212
/** Version placeholder is replaced during the build process with actual package version */
13-
const VERSION = '19.0.0-next.2+sha-7f570c5';
13+
const VERSION = '19.0.0-next.2+sha-3ee2163';
1414
function hasCacheMetadata(value) {
1515
return (!!value &&
1616
typeof value === 'object' &&

uniqueId

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Thu Aug 29 2024 08:44:50 GMT+0000 (Coordinated Universal Time)
1+
Thu Aug 29 2024 19:04:28 GMT+0000 (Coordinated Universal Time)

0 commit comments

Comments
 (0)