angular-docs-cn/public/docs/js/latest/api/test/fakeAsync-function.jade

24 lines
721 B
Plaintext
Raw Normal View History

.l-main-section
h2(class="function export") fakeAsync
pre.prettyprint
code.
fakeAsync(fn: Function) : Function
p.location-badge.
exported from <a href='../test'>angular2/test</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/test_lib/fake_async.ts#L15-L66">angular2/src/test_lib/fake_async.ts (line 15)</a>
:markdown
Wraps a function to be executed in the fakeAsync zone:
- microtasks are manually executed by calling `flushMicrotasks()`,
- timers are synchronous, `tick()` simulates the asynchronous passage of time.
If there are any pending timers at the end of the function, an exception will be thrown.