File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
angular_devkit/build_angular/src/builders/karma
schematics/angular/config/files Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,12 @@ export function execute(
146
146
logger : context . logger ,
147
147
} ;
148
148
149
+ // Workaround https://github.com/angular/angular-cli/issues/28271, by clearing context by default
150
+ // for single run executions. Not clearing context for multi-run (watched) builds allows the
151
+ // Jasmine Spec Runner to be visible in the browser after test execution.
152
+ karmaOptions . client ??= { } ;
153
+ karmaOptions . client . clearContext ??= singleRun ?? false ; // `singleRun` defaults to `false` per Karma docs.
154
+
149
155
const parsedKarmaConfig = await karma . config . parseConfig (
150
156
options . karmaConfig && path . resolve ( context . workspaceRoot , options . karmaConfig ) ,
151
157
transforms . karmaOptions ? transforms . karmaOptions ( karmaOptions ) : karmaOptions ,
@@ -208,9 +214,6 @@ function getBuiltInKarmaConfig(
208
214
'karma-coverage' ,
209
215
'@angular-devkit/build-angular/plugins/karma' ,
210
216
] . map ( ( p ) => workspaceRootRequire ( p ) ) ,
211
- client : {
212
- clearContext : false , // leave Jasmine Spec Runner output visible in browser
213
- } ,
214
217
jasmineHtmlReporter : {
215
218
suppressAll : true , // removes the duplicated traces
216
219
} ,
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ module.exports = function (config) {
19
19
// for example, you can disable the random execution with `random: false`
20
20
// or set a specific seed with `seed: 4321`
21
21
},
22
- clearContext: false // leave Jasmine Spec Runner output visible in browser
23
22
},
24
23
jasmineHtmlReporter: {
25
24
suppressAll: true // removes the duplicated traces
You can’t perform that action at this time.
0 commit comments