-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core):
ComponentFixture
stability should match ApplicationRef
This change aligns the stability of `ComponentFixture` with that of `ApplicationRef`, preventing confusing differences between the two as more APIs start using the `PendingTasks` that may not be tracked by `NgZone`. BREAKING CHANGE: `ComponentFixture.whenStable` now matches the `ApplicationRef.isStable` observable. Prior to this change, stability of the fixture did not include everything that was considered in `ApplicationRef`. `whenStable` of the fixture will now include unfinished router navigations and unfinished `HttpClient` requests. This will cause tests that `await` the `whenStable` promise to time out when there are incomplete requests. To fix this, remove the `whenStable`, instead wait for another condition, or ensure `HttpTestingController` mocks responses for all requests. Try adding `HttpTestingController.verify()` before your `await fixture.whenStable` to identify the open requests. In addition, `ComponentFixture.isStable` would synchronously switch to true in some scenarios but will now always be asynchronous.
- Loading branch information
Showing
4 changed files
with
31 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters