@@ -338,7 +338,7 @@ async function getProjectSourceRoot(context: BuilderContext): Promise<string> {
338
338
}
339
339
340
340
function normalizePolyfills (
341
- polyfills : string [ ] | undefined = [ ] ,
341
+ polyfills : string [ ] = [ ] ,
342
342
) : [ polyfills : string [ ] , jasmineCleanup : string [ ] ] {
343
343
const jasmineGlobalEntryPoint = localResolve ( './polyfills/jasmine_global.js' ) ;
344
344
const jasmineGlobalCleanupEntrypoint = localResolve ( './polyfills/jasmine_global_cleanup.js' ) ;
@@ -711,8 +711,6 @@ function getBaseKarmaOptions(
711
711
options : NormalizedKarmaBuilderOptions ,
712
712
context : BuilderContext ,
713
713
) : ConfigOptions {
714
- const singleRun = ! options . watch ;
715
-
716
714
// Determine project name from builder context target
717
715
const projectName = context . target ?. project ;
718
716
if ( ! projectName ) {
@@ -723,13 +721,14 @@ function getBaseKarmaOptions(
723
721
? { }
724
722
: getBuiltInKarmaConfig ( context . workspaceRoot , projectName ) ;
725
723
724
+ const singleRun = ! options . watch ;
726
725
karmaOptions . singleRun = singleRun ;
727
726
728
727
// Workaround https://github.com/angular/angular-cli/issues/28271, by clearing context by default
729
728
// for single run executions. Not clearing context for multi-run (watched) builds allows the
730
729
// Jasmine Spec Runner to be visible in the browser after test execution.
731
730
karmaOptions . client ??= { } ;
732
- karmaOptions . client . clearContext ??= singleRun ?? false ; // `singleRun` defaults to `false` per Karma docs.
731
+ karmaOptions . client . clearContext ??= singleRun ;
733
732
734
733
// Convert browsers from a string to an array
735
734
if ( options . browsers ) {
0 commit comments