Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): fix --watch regression in karma
Browse files Browse the repository at this point in the history
Outside of single-run mode, the karma test provider was expected to
watch for changes. In the application builder branch, we only handled
the case of an explicit `--watch` though. This meant that the karma
runner was kept running but didn't see any file changes.

Fixes #28730

(cherry picked from commit 8646751)
  • Loading branch information
jkrems committed Oct 29, 2024
1 parent f8677f6 commit 476f94f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export function execute(
switchMap(
([karma, karmaConfig, buildOptions]) =>
new Observable<BuilderOutput>((subscriber) => {
if (options.watch) {
// If `--watch` is explicitly enabled or if we are keeping the Karma
// process running, we should hook Karma into the build.
if (options.watch ?? !karmaConfig.singleRun) {
injectKarmaReporter(context, buildOptions, karmaConfig, subscriber);
}

Expand Down

0 comments on commit 476f94f

Please sign in to comment.