angular-docs-cn/tools
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
..
analytics chore(): remove all angular2_material code. 2016-03-16 13:37:37 -07:00
broccoli feat(tests): manage asynchronous tests using zones 2016-04-18 15:59:07 -07:00
build fix(build): ignore dart warnings `The name … is shown, but not used` 2016-04-13 09:49:33 -07:00
cjs-jasmine feat(tests): manage asynchronous tests using zones 2016-04-18 15:59:07 -07:00
code.angularjs.org chore(publish): add Rx bundles to code.angularjs.org publish step 2015-12-15 17:12:42 +00:00
karma fix(build): fix source maps 2015-11-24 19:33:27 +00:00
metadata revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
npm build(npm): add tools/npm/reshrinkwrap script and update docs 2016-01-22 03:25:33 +00:00
public_api_guard refactor(view_compiler): codegen DI and Queries 2016-04-13 14:43:48 -07:00
travis build(travis): add travis log folding for verbose tasks 2015-10-03 21:33:57 +00:00
tslint revert(format): Revert "chore(format): update to latest formatter" 2016-04-12 09:41:01 -07:00
check-environment.js build(gulp): fail hard w/ legacy node version and provide clear upgrade instructions 2016-01-22 03:25:34 +00:00
chromedriverpatch.js chore(testing): update protractor to version 2.1.0 2015-05-20 17:28:23 -07:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
tsconfig.json chore(typescript 1.6 upgrade): fix build.tools 2015-09-25 20:15:55 +00:00
tsd.json chore(typings): use mainline DefinitelyTyped repo rather than a fork. 2016-02-04 22:42:40 +00:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00