Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(testing): 'testingService' -> 'twainService' plus clarity #2692

Merged
merged 1 commit into from
Oct 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions public/docs/ts/latest/guide/testing.jade
Original file line number Diff line number Diff line change
Expand Up @@ -743,11 +743,12 @@ a(href="#top").to-top Back to top
## _whenStable_
The test must wait for the `getQuote` promise to resolve in the next turn of the JavaScript engine.

This test has no direct access to the promise returned by the call to `testService.getQuote`
which is private and inaccessible inside `TwainComponent`.
This test has no direct access to the promise returned by the call to `twainService.getQuote`
because it is buried inside `TwainComponent.ngOnInit` and therefore inaccessible to a test that
probes only the component API surface.

Fortunately, the `getQuote` promise is accessible to the _async test zone_
which intercepts all promises issued within the _async_ method call.
which intercepts all promises issued within the _async_ method call _no matter where they occur_.

The `ComponentFixture.whenStable` method returns its own promise which resolves when the `getQuote` promise completes.
In fact, the _whenStable_ promise resolves when _all pending asynchronous activities within this test_ complete ... the definition of "stable".
Expand Down