-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@angular/build): resolve "Controller is already closed" error in Karma #30653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3bb2141
to
c621772
Compare
9d404a8
to
ef6092c
Compare
6bb0cf1
to
4673259
Compare
f38af30
to
9bee394
Compare
packages/angular/build/src/builders/karma/application_builder.ts
Outdated
Show resolved
Hide resolved
packages/angular/build/src/builders/karma/application_builder.ts
Outdated
Show resolved
Hide resolved
@@ -229,7 +229,8 @@ | |||
}, | |||
"watch": { | |||
"type": "boolean", | |||
"description": "Run build when files change." | |||
"description": "Re-run tests when source files change.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-checking: Was it ever a thing that the karma builder would default to non-watching outside of TTY?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
@@ -44,7 +44,7 @@ | |||
}, | |||
"watch": { | |||
"type": "boolean", | |||
"description": "Run build when files change." | |||
"description": "Re-run tests when source files change. Defaults to `false` in TTY environments and `true` otherwise." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the default flipped here? I assume we do watch in TTY environments and don't outside of them? (Ref https://nodejs.org/api/tty.html#tty)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant false in non-TTY.
…Karma This issue stems from the `Some of your tests did a full page reload` error, which occurs because `karmaOptions.client.clearContext` is set to `true` when `singleRun` is `false`, even though Karma is running in watch mode. Previously, the `watch` flag was configured inconsistently across multiple locations, leading to misalignment. Closes angular#30506
9bee394
to
29bd9db
Compare
Descriptions for the "watch" option where not clear.
…lders This ensures a cleaner and easier to follow code and also avoid having the fix bugs in multiple places.
29bd9db
to
9e1d328
Compare
The changes were merged into the following branches: main, 20.1.x |
This issue stems from the
Some of your tests did a full page reload
error, which occurs becausekarmaOptions.client.clearContext
is set totrue
whensingleRun
isfalse
, even though Karma is running in watch mode. Previously, thewatch
flag was configured inconsistently across multiple locations, leading to misalignment.Closes #30506