angular/modules/angular2/test
Julie Ralph 8490921fb3 feat(tests): manage asynchronous tests using zones
Instead of using injectAsync and returning a promise, use the `async` function
to wrap tests. This will run the test inside a zone which does not complete
the test until all asynchronous tasks have been completed.

`async` may be used with the `inject` function, or separately.

BREAKING CHANGE:

`injectAsync` is now deprecated. Instead, use the `async` function
to wrap any asynchronous tests.

Before:
```
it('should wait for returned promises', injectAsync([FancyService], (service) => {
  return service.getAsyncValue().then((value) => { expect(value).toEqual('async value'); });
}));

it('should wait for returned promises', injectAsync([], () => {
  return somePromise.then(() => { expect(true).toEqual(true); });
}));
```

After:
```
it('should wait for returned promises', async(inject([FancyService], (service) => {
  service.getAsyncValue().then((value) => { expect(value).toEqual('async value'); });
})));

// Note that if there is no injection, we no longer need `inject` OR `injectAsync`.
it('should wait for returned promises', async(() => {
  somePromise.then() => { expect(true).toEqual(true); });
}));
```

Closes #7735
2016-04-18 15:59:07 -07:00
..
animate revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
common refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
compiler feat(i18n): add support for nested expansion forms 2016-04-18 19:38:12 +00:00
core refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
facade revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
http revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
i18n feat(i18n): add support for nested expansion forms 2016-04-18 19:38:12 +00:00
mock revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
platform refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
router refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
symbol_inspector refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
testing feat(tests): manage asynchronous tests using zones 2016-04-18 15:59:07 -07:00
upgrade revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
web_workers refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
dev_mode_spec.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
public_api_spec.ts refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00