mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Instead, the async function now determines whether it should return a promise
or instead call a done function parameter. Importing Jasmine functions
from `@angular/core/testing` is no longer necessary and is now deprecated.
Additionally, beforeEachProviders is also deprecated, as it is specific
to the testing framework. Instead, use the new addProviders method directly.
Before:
```js
import {beforeEachProviders, it, describe, inject} from 'angular2/testing/core';
describe('my code', () => {
beforeEachProviders(() => [MyService]);
it('does stuff', inject([MyService], (service) => {
// actual test
});
});
```
After:
```js
import {addProviders, inject} from 'angular2/testing/core';
describe('my code', () => {
beforeEach(() => {
addProviders([MyService]);
});
it('does stuff', inject([MyService], (service) => {
// actual test
});
});
```
|
||
|---|---|---|
| .. | ||
| src | ||
| test | ||
| testing | ||
| core.dart | ||
| index.ts | ||
| package.json | ||
| private_export.dart | ||
| private_export.ts | ||
| rollup.config.js | ||
| testing.ts | ||
| tsconfig-es5.json | ||
| tsconfig-es2015.json | ||