1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Component, Directive, Injector, NgModule, OpaqueToken, Pipe, PlatformRef, SchemaMetadata, Type } from '@angular/core';
|
9 | import { ComponentFixture } from './component_fixture';
|
10 | import { MetadataOverride } from './metadata_override';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export declare class TestComponentRenderer {
|
17 | insertRootElement(rootElementId: string): void;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 | export declare const ComponentFixtureAutoDetect: OpaqueToken;
|
23 |
|
24 |
|
25 |
|
26 | export declare const ComponentFixtureNoNgZone: OpaqueToken;
|
27 |
|
28 |
|
29 |
|
30 | export declare type TestModuleMetadata = {
|
31 | providers?: any[];
|
32 | declarations?: any[];
|
33 | imports?: any[];
|
34 | schemas?: Array<SchemaMetadata | any[]>;
|
35 | };
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export declare class TestBed implements Injector {
|
46 | |
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | static initTestEnvironment(ngModule: Type<any>, platform: PlatformRef): TestBed;
|
60 | |
61 |
|
62 |
|
63 |
|
64 |
|
65 | static resetTestEnvironment(): void;
|
66 | static resetTestingModule(): typeof TestBed;
|
67 | |
68 |
|
69 |
|
70 |
|
71 | static configureCompiler(config: {
|
72 | providers?: any[];
|
73 | useJit?: boolean;
|
74 | }): typeof TestBed;
|
75 | |
76 |
|
77 |
|
78 |
|
79 | static configureTestingModule(moduleDef: TestModuleMetadata): typeof TestBed;
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 | static compileComponents(): Promise<any>;
|
86 | static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): typeof TestBed;
|
87 | static overrideComponent(component: Type<any>, override: MetadataOverride<Component>): typeof TestBed;
|
88 | static overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): typeof TestBed;
|
89 | static overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): typeof TestBed;
|
90 | static get(token: any, notFoundValue?: any): any;
|
91 | static createComponent<T>(component: Type<T>): ComponentFixture<T>;
|
92 | private _instantiated;
|
93 | private _compiler;
|
94 | private _moduleRef;
|
95 | private _moduleWithComponentFactories;
|
96 | private _compilerOptions;
|
97 | private _moduleOverrides;
|
98 | private _componentOverrides;
|
99 | private _directiveOverrides;
|
100 | private _pipeOverrides;
|
101 | private _providers;
|
102 | private _declarations;
|
103 | private _imports;
|
104 | private _schemas;
|
105 | private _activeFixtures;
|
106 | |
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 | initTestEnvironment(ngModule: Type<any>, platform: PlatformRef): void;
|
120 | |
121 |
|
122 |
|
123 |
|
124 |
|
125 | resetTestEnvironment(): void;
|
126 | resetTestingModule(): void;
|
127 | platform: PlatformRef;
|
128 | ngModule: Type<any>;
|
129 | configureCompiler(config: {
|
130 | providers?: any[];
|
131 | useJit?: boolean;
|
132 | }): void;
|
133 | configureTestingModule(moduleDef: TestModuleMetadata): void;
|
134 | compileComponents(): Promise<any>;
|
135 | private _initIfNeeded();
|
136 | private _createCompilerAndModule();
|
137 | private _assertNotInstantiated(methodName, methodDescription);
|
138 | get(token: any, notFoundValue?: any): any;
|
139 | execute(tokens: any[], fn: Function): any;
|
140 | overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void;
|
141 | overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;
|
142 | overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;
|
143 | overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void;
|
144 | createComponent<T>(component: Type<T>): ComponentFixture<T>;
|
145 | }
|
146 |
|
147 |
|
148 |
|
149 | export declare function getTestBed(): TestBed;
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 | export declare function inject(tokens: any[], fn: Function): () => any;
|
175 |
|
176 |
|
177 |
|
178 | export declare class InjectSetupWrapper {
|
179 | private _moduleDef;
|
180 | constructor(_moduleDef: () => TestModuleMetadata);
|
181 | private _addModule();
|
182 | inject(tokens: any[], fn: Function): () => any;
|
183 | }
|
184 | /**
|
185 | * @experimental
|
186 | */
|
187 | export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
|
188 | export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;
|