waitForAsync
把一个测试函数包装进一个异步测试 Zone。当该 Zone 中的所有异步调用都已完成时,该测试将会自动完成。 可用于包装 inject调用。
Wraps a test function in an asynchronous test zone. The test will automatically complete when all asynchronous calls within this zone are done. Can be used to wrap an injectcall.
说明
例子:
Example:
it('...', waitForAsync(inject([AClass], (object) => {
object.doSomething.then(() => {
expect(...);
})
});