This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree 1 file changed +4
-3
lines changed
public/docs/ts/latest/guide
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -743,11 +743,12 @@ a(href="#top").to-top Back to top
743
743
## _whenStable_
744
744
The test must wait for the `getQuote` promise to resolve in the next turn of the JavaScript engine.
745
745
746
- This test has no direct access to the promise returned by the call to `testService.getQuote`
747
- which is private and inaccessible inside `TwainComponent`.
746
+ This test has no direct access to the promise returned by the call to `twainService.getQuote`
747
+ because it is buried inside `TwainComponent.ngOnInit` and therefore inaccessible to a test that
748
+ probes only the component API surface.
748
749
749
750
Fortunately, the `getQuote` promise is accessible to the _async test zone_
750
- which intercepts all promises issued within the _async_ method call.
751
+ which intercepts all promises issued within the _async_ method call _no matter where they occur_ .
751
752
752
753
The `ComponentFixture.whenStable` method returns its own promise which resolves when the `getQuote` promise completes.
753
754
In fact, the _whenStable_ promise resolves when _all pending asynchronous activities within this test_ complete ... the definition of "stable".
You can’t perform that action at this time.
0 commit comments