injectAsync

export injectAsync(tokens: any[], fn: Function) : FunctionWithParamTokens

exported from angular2/testing defined in angular2/src/testing/test_injector.ts (line 223)

Allows injecting dependencies in beforeEach() and it(). The test must return a promise which will resolve when all asynchronous activity is complete.

Example:

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