填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

async

把一个测试函数包装进一个异步测试区域(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.

查看"说明"...

async(fn: Function): (done: any) => any
      
      async(fn: Function): (done: any) => any
    
参数
fn Function
返回值

(done: any) => any

说明

例子:

Example:

it('...', async(inject([AClass], (object) => { object.doSomething.then(() => { expect(...); }) });
      
      it('...', async(inject([AClass], (object) => {
  object.doSomething.then(() => {
    expect(...);
  })
});