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

Commit 48cd008

Browse files
authored
docs(testing): 'testingService' -> 'twainService' plus clarity (#2692)
1 parent b44cc42 commit 48cd008

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

public/docs/ts/latest/guide/testing.jade

+4-3
Original file line numberDiff line numberDiff line change
@@ -743,11 +743,12 @@ a(href="#top").to-top Back to top
743743
## _whenStable_
744744
The test must wait for the `getQuote` promise to resolve in the next turn of the JavaScript engine.
745745

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.
748749

749750
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_.
751752

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

0 commit comments

Comments
 (0)