Commit f596a3d 1 parent 56fa051 commit f596a3d Copy full SHA for f596a3d
File tree 2 files changed +6
-4
lines changed
angular_devkit/build_angular/src/builders/karma
schematics/angular/config/files
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,12 @@ export function execute(
99
99
100
100
karmaOptions . singleRun = singleRun ;
101
101
102
+ // Workaround https://github.com/angular/angular-cli/issues/28271, by clearing context by default
103
+ // for single run executions. Not clearing context for multi-run (watched) builds allows the
104
+ // Jasmine Spec Runner to be visible in the browser after test execution.
105
+ karmaOptions . client ??= { } ;
106
+ karmaOptions . client . clearContext ??= singleRun ?? false ; // `singleRun` defaults to `false` per Karma docs.
107
+
102
108
// Convert browsers from a string to an array
103
109
if ( options . browsers ) {
104
110
karmaOptions . browsers = options . browsers . split ( ',' ) ;
@@ -207,9 +213,6 @@ function getBuiltInKarmaConfig(
207
213
'karma-coverage' ,
208
214
'@angular-devkit/build-angular/plugins/karma' ,
209
215
] . map ( ( p ) => workspaceRootRequire ( p ) ) ,
210
- client : {
211
- clearContext : false , // leave Jasmine Spec Runner output visible in browser
212
- } ,
213
216
jasmineHtmlReporter : {
214
217
suppressAll : true , // removes the duplicated traces
215
218
} ,
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