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 @@ -98,6 +98,12 @@ export function execute(
9898
9999 karmaOptions . singleRun = singleRun ;
100100
101+ // Workaround https://github.com/angular/angular-cli/issues/28271, by clearing context by default
102+ // for single run executions. Not clearing context for multi-run (watched) builds allows the
103+ // Jasmine Spec Runner to be visible in the browser after test execution.
104+ karmaOptions . client ??= { } ;
105+ karmaOptions . client . clearContext ??= singleRun ?? false ; // `singleRun` defaults to `false` per Karma docs.
106+
101107 // Convert browsers from a string to an array
102108 if ( typeof options . browsers === 'string' && options . browsers ) {
103109 karmaOptions . browsers = options . browsers . split ( ',' ) ;
@@ -208,9 +214,6 @@ function getBuiltInKarmaConfig(
208214 'karma-coverage' ,
209215 '@angular-devkit/build-angular/plugins/karma' ,
210216 ] . map ( ( p ) => workspaceRootRequire ( p ) ) ,
211- client : {
212- clearContext : false , // leave Jasmine Spec Runner output visible in browser
213- } ,
214217 jasmineHtmlReporter : {
215218 suppressAll : true , // removes the duplicated traces
216219 } ,
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ module.exports = function (config) {
1919 // for example, you can disable the random execution with `random: false`
2020 // or set a specific seed with `seed: 4321`
2121 },
22- clearContext: false // leave Jasmine Spec Runner output visible in browser
2322 },
2423 jasmineHtmlReporter: {
2524 suppressAll: true // removes the duplicated traces
You can’t perform that action at this time.
0 commit comments