refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare function addProviders(providers: Array<any>): void;
|
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare var afterEach: Function;
|
|
|
|
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare function async(fn: Function): (done: any) => any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare var beforeEach: any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare function beforeEachProviders(fn: () => Array<any>): void;
|
|
|
|
|
2016-06-24 15:41:49 -04:00
|
|
|
export declare class ComponentFixture<T> {
|
|
|
|
changeDetectorRef: ChangeDetectorRef;
|
|
|
|
componentInstance: any;
|
|
|
|
componentRef: ComponentRef<T>;
|
|
|
|
debugElement: DebugElement;
|
|
|
|
elementRef: ElementRef;
|
|
|
|
nativeElement: any;
|
|
|
|
ngZone: NgZone;
|
|
|
|
constructor(componentRef: ComponentRef<T>, ngZone: NgZone, autoDetect: boolean);
|
|
|
|
autoDetectChanges(autoDetect?: boolean): void;
|
|
|
|
checkNoChanges(): void;
|
|
|
|
destroy(): void;
|
|
|
|
detectChanges(checkNoChanges?: boolean): void;
|
|
|
|
isStable(): boolean;
|
|
|
|
whenStable(): Promise<any>;
|
|
|
|
}
|
|
|
|
|
2016-06-24 20:35:01 -04:00
|
|
|
export declare var ComponentFixtureAutoDetect: OpaqueToken;
|
|
|
|
|
|
|
|
export declare var ComponentFixtureNoNgZone: OpaqueToken;
|
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare var ddescribe: any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare var describe: Function;
|
|
|
|
|
|
|
|
export declare function discardPeriodicTasks(): void;
|
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare var expect: Function;
|
|
|
|
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare function fakeAsync(fn: Function): (...args: any[]) => any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare var fdescribe: any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare var fit: any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
|
|
|
export declare function flushMicrotasks(): void;
|
|
|
|
|
|
|
|
export declare function getTestInjector(): TestInjector;
|
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare var iit: any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare function inject(tokens: any[], fn: Function): () => any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
|
|
|
export declare class InjectSetupWrapper {
|
|
|
|
constructor(_providers: () => any);
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
inject(tokens: any[], fn: Function): () => any;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare var it: any;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
|
|
|
export declare function resetBaseTestProviders(): void;
|
|
|
|
|
|
|
|
export declare function setBaseTestProviders(platformProviders: Array<Type | Provider | any[]>, applicationProviders: Array<Type | Provider | any[]>): void;
|
|
|
|
|
2016-06-24 20:35:01 -04:00
|
|
|
export declare class TestComponentBuilder {
|
|
|
|
protected _injector: Injector;
|
|
|
|
constructor(_injector: Injector);
|
|
|
|
createAsync(rootComponentType: Type): Promise<ComponentFixture<any>>;
|
|
|
|
createFakeAsync(rootComponentType: Type): ComponentFixture<any>;
|
|
|
|
protected createFromFactory<C>(ngZone: NgZone, componentFactory: ComponentFactory<C>): ComponentFixture<C>;
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */ createSync<C>(componentFactory: ComponentFactory<C>): ComponentFixture<C>;
|
2016-06-24 20:35:01 -04:00
|
|
|
overrideAnimations(componentType: Type, animations: AnimationEntryMetadata[]): TestComponentBuilder;
|
|
|
|
overrideDirective(componentType: Type, from: Type, to: Type): TestComponentBuilder;
|
|
|
|
overrideProviders(type: Type, providers: any[]): TestComponentBuilder;
|
|
|
|
overrideTemplate(componentType: Type, template: string): TestComponentBuilder;
|
|
|
|
overrideView(componentType: Type, view: ViewMetadata): TestComponentBuilder;
|
|
|
|
overrideViewProviders(type: Type, providers: any[]): TestComponentBuilder;
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare class TestComponentRenderer {
|
|
|
|
insertRootElement(rootElementId: string): void;
|
|
|
|
}
|
|
|
|
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class TestInjector {
|
|
|
|
applicationProviders: Array<Type | Provider | any[] | any>;
|
2016-06-23 21:19:32 -04:00
|
|
|
platformProviders: Array<Type | Provider | any[] | any>;
|
2016-06-22 17:56:10 -04:00
|
|
|
addProviders(providers: Array<Type | Provider | any[] | any>): void;
|
|
|
|
createInjector(): ReflectiveInjector;
|
|
|
|
execute(tokens: any[], fn: Function): any;
|
2016-06-23 21:19:32 -04:00
|
|
|
get(token: any): any;
|
|
|
|
reset(): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare function tick(millis?: number): void;
|
|
|
|
|
|
|
|
export declare function withProviders(providers: () => any): InjectSetupWrapper;
|
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare var xdescribe: Function;
|
|
|
|
|
2016-06-27 13:02:02 -04:00
|
|
|
/** @deprecated */
|
refactor(testing): remove wrapping of Jasmine functions (#9564)
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
});
});
```
2016-06-24 20:48:35 -04:00
|
|
|
export declare var xit: any;
|