angular-cn/tools/broccoli
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
..
html-replace revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
js-replace revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
trees feat(tests): manage asynchronous tests using zones 2016-04-18 15:59:07 -07:00
angular_builder.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-check-imports.ts refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
broccoli-dartfmt.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-dest-copy.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-filter.d.ts feat(build): Move HTML copying into the broccoli task. 2015-04-14 11:54:31 -07:00
broccoli-flatten.spec.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-flatten.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-generate-for-test.ts refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
broccoli-lodash.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-merge-trees.spec.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-merge-trees.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-replace.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-tree-stabilizer.ts chore(build): Produce .d.ts files for build tools 2016-03-25 18:23:00 +00:00
broccoli-ts2dart.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-typescript.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli-writer.d.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
broccoli.d.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
diffing-broccoli-plugin.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
multi_copy.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
tree-differ.spec.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
tree-differ.ts revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00