@angular/core 14.0.0-next.9 → 14.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/esm2020/src/application_ref.mjs +232 -66
  2. package/esm2020/src/application_tokens.mjs +5 -2
  3. package/esm2020/src/change_detection/change_detection.mjs +2 -2
  4. package/esm2020/src/change_detection/change_detector_ref.mjs +3 -3
  5. package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +3 -3
  6. package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +3 -3
  7. package/esm2020/src/change_detection/differs/iterable_differs.mjs +2 -2
  8. package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +2 -2
  9. package/esm2020/src/compiler/compiler_facade.mjs +2 -2
  10. package/esm2020/src/compiler/compiler_facade_interface.mjs +7 -1
  11. package/esm2020/src/console.mjs +4 -3
  12. package/esm2020/src/core.mjs +2 -2
  13. package/esm2020/src/core_private_export.mjs +5 -3
  14. package/esm2020/src/core_render3_private_export.mjs +4 -3
  15. package/esm2020/src/debug/debug_node.mjs +5 -5
  16. package/esm2020/src/di/create_injector.mjs +35 -0
  17. package/esm2020/src/di/index.mjs +4 -1
  18. package/esm2020/src/di/initializer_token.mjs +16 -0
  19. package/esm2020/src/di/injection_token.mjs +7 -1
  20. package/esm2020/src/di/injector.mjs +3 -3
  21. package/esm2020/src/di/injector_compatibility.mjs +4 -6
  22. package/esm2020/src/di/injector_token.mjs +2 -2
  23. package/esm2020/src/di/interface/defs.mjs +1 -1
  24. package/esm2020/src/di/interface/provider.mjs +1 -1
  25. package/esm2020/src/di/internal_tokens.mjs +10 -0
  26. package/esm2020/src/di/jit/injectable.mjs +3 -3
  27. package/esm2020/src/di/metadata.mjs +6 -6
  28. package/esm2020/src/di/provider_collection.mjs +224 -0
  29. package/esm2020/src/di/r3_injector.mjs +87 -157
  30. package/esm2020/src/di/scope.mjs +1 -1
  31. package/esm2020/src/errors.mjs +1 -1
  32. package/esm2020/src/linker/component_factory.mjs +1 -1
  33. package/esm2020/src/linker/ng_module_factory.mjs +1 -1
  34. package/esm2020/src/linker/template_ref.mjs +3 -3
  35. package/esm2020/src/linker/view_container_ref.mjs +15 -12
  36. package/esm2020/src/metadata/directives.mjs +1 -1
  37. package/esm2020/src/metadata/ng_module.mjs +1 -1
  38. package/esm2020/src/metadata.mjs +1 -1
  39. package/esm2020/src/platform_core_providers.mjs +3 -14
  40. package/esm2020/src/render3/assert.mjs +3 -3
  41. package/esm2020/src/render3/bindings.mjs +2 -2
  42. package/esm2020/src/render3/collect_native_nodes.mjs +5 -5
  43. package/esm2020/src/render3/component.mjs +8 -8
  44. package/esm2020/src/render3/component_ref.mjs +15 -7
  45. package/esm2020/src/render3/context_discovery.mjs +4 -4
  46. package/esm2020/src/render3/definition.mjs +18 -20
  47. package/esm2020/src/render3/di.mjs +21 -21
  48. package/esm2020/src/render3/di_setup.mjs +7 -6
  49. package/esm2020/src/render3/errors.mjs +22 -4
  50. package/esm2020/src/render3/errors_di.mjs +10 -7
  51. package/esm2020/src/render3/features/inherit_definition_feature.mjs +4 -3
  52. package/esm2020/src/render3/features/standalone_feature.mjs +70 -0
  53. package/esm2020/src/render3/hooks.mjs +19 -19
  54. package/esm2020/src/render3/i18n/i18n_apply.mjs +16 -16
  55. package/esm2020/src/render3/i18n/i18n_debug.mjs +9 -9
  56. package/esm2020/src/render3/i18n/i18n_insert_before_index.mjs +2 -2
  57. package/esm2020/src/render3/i18n/i18n_parse.mjs +14 -14
  58. package/esm2020/src/render3/i18n/i18n_util.mjs +7 -7
  59. package/esm2020/src/render3/index.mjs +5 -4
  60. package/esm2020/src/render3/instructions/advance.mjs +4 -4
  61. package/esm2020/src/render3/instructions/all.mjs +2 -1
  62. package/esm2020/src/render3/instructions/change_detection.mjs +2 -2
  63. package/esm2020/src/render3/instructions/element.mjs +47 -12
  64. package/esm2020/src/render3/instructions/element_container.mjs +3 -3
  65. package/esm2020/src/render3/instructions/i18n.mjs +2 -2
  66. package/esm2020/src/render3/instructions/listener.mjs +8 -11
  67. package/esm2020/src/render3/instructions/lview_debug.mjs +26 -26
  68. package/esm2020/src/render3/instructions/projection.mjs +3 -3
  69. package/esm2020/src/render3/instructions/shared.mjs +133 -87
  70. package/esm2020/src/render3/instructions/styling.mjs +5 -5
  71. package/esm2020/src/render3/instructions/template.mjs +3 -3
  72. package/esm2020/src/render3/instructions/text.mjs +2 -2
  73. package/esm2020/src/render3/interfaces/definition.mjs +1 -1
  74. package/esm2020/src/render3/interfaces/node.mjs +10 -10
  75. package/esm2020/src/render3/interfaces/public_definitions.mjs +1 -1
  76. package/esm2020/src/render3/interfaces/styling.mjs +18 -18
  77. package/esm2020/src/render3/interfaces/type_checks.mjs +5 -5
  78. package/esm2020/src/render3/interfaces/view.mjs +1 -1
  79. package/esm2020/src/render3/jit/directive.mjs +135 -13
  80. package/esm2020/src/render3/jit/environment.mjs +2 -1
  81. package/esm2020/src/render3/jit/module.mjs +84 -27
  82. package/esm2020/src/render3/jit/partial.mjs +8 -8
  83. package/esm2020/src/render3/jit/pipe.mjs +4 -6
  84. package/esm2020/src/render3/jit/util.mjs +15 -0
  85. package/esm2020/src/render3/ng_module_ref.mjs +34 -4
  86. package/esm2020/src/render3/node_assert.mjs +8 -8
  87. package/esm2020/src/render3/node_manipulation.mjs +40 -40
  88. package/esm2020/src/render3/node_manipulation_i18n.mjs +3 -3
  89. package/esm2020/src/render3/node_selector_matcher.mjs +28 -28
  90. package/esm2020/src/render3/pipe.mjs +2 -2
  91. package/esm2020/src/render3/query.mjs +12 -12
  92. package/esm2020/src/render3/state.mjs +21 -10
  93. package/esm2020/src/render3/styling/class_differ.mjs +3 -3
  94. package/esm2020/src/render3/styling/static_styling.mjs +3 -3
  95. package/esm2020/src/render3/styling/styling_parser.mjs +17 -17
  96. package/esm2020/src/render3/util/attrs_utils.mjs +10 -10
  97. package/esm2020/src/render3/util/discovery_utils.mjs +4 -4
  98. package/esm2020/src/render3/util/injector_utils.mjs +4 -4
  99. package/esm2020/src/render3/util/view_traversal_utils.mjs +2 -2
  100. package/esm2020/src/render3/util/view_utils.mjs +3 -3
  101. package/esm2020/src/render3/view_ref.mjs +12 -8
  102. package/esm2020/src/sanitization/bypass.mjs +7 -7
  103. package/esm2020/src/sanitization/sanitization.mjs +10 -10
  104. package/esm2020/src/testability/testability.mjs +69 -19
  105. package/esm2020/src/util/global.mjs +8 -8
  106. package/esm2020/src/util/raf.mjs +1 -1
  107. package/esm2020/src/version.mjs +1 -1
  108. package/esm2020/testing/src/logger.mjs +3 -3
  109. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  110. package/esm2020/testing/src/r3_test_bed.mjs +38 -13
  111. package/esm2020/testing/src/r3_test_bed_compiler.mjs +45 -4
  112. package/esm2020/testing/src/resolvers.mjs +1 -1
  113. package/esm2020/testing/src/test_bed.mjs +1 -1
  114. package/esm2020/testing/src/test_bed_common.mjs +5 -1
  115. package/fesm2015/core.mjs +1785 -942
  116. package/fesm2015/core.mjs.map +1 -1
  117. package/fesm2015/testing.mjs +88 -15
  118. package/fesm2015/testing.mjs.map +1 -1
  119. package/fesm2020/core.mjs +1780 -943
  120. package/fesm2020/core.mjs.map +1 -1
  121. package/fesm2020/testing.mjs +85 -15
  122. package/fesm2020/testing.mjs.map +1 -1
  123. package/{core.d.ts → index.d.ts} +14774 -14596
  124. package/package.json +4 -4
  125. package/schematics/migrations/path-match-type/index.d.ts +11 -0
  126. package/schematics/migrations/path-match-type/index.js +95 -0
  127. package/schematics/migrations/path-match-type/transform.d.ts +19 -0
  128. package/schematics/migrations/path-match-type/transform.js +48 -0
  129. package/schematics/migrations/path-match-type/update_recorder.d.ts +18 -0
  130. package/schematics/migrations/path-match-type/update_recorder.js +20 -0
  131. package/schematics/migrations/path-match-type/util.d.ts +11 -0
  132. package/schematics/migrations/path-match-type/util.js +106 -0
  133. package/schematics/migrations.json +8 -3
  134. package/testing/{testing.d.ts → index.d.ts} +565 -577
  135. package/esm2020/src/change_detection/change_detection_util.mjs +0 -64
  136. package/testing/package.json +0 -9
@@ -1,582 +1,570 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.9
2
+ * @license Angular v14.0.0-rc.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { ChangeDetectorRef } from '@angular/core';
8
- import { Component } from '@angular/core';
9
- import { ComponentRef } from '@angular/core';
10
- import { DebugElement } from '@angular/core';
11
- import { Directive } from '@angular/core';
12
- import { ElementRef } from '@angular/core';
13
- import { InjectFlags } from '@angular/core';
14
- import { InjectionToken } from '@angular/core';
15
- import { NgModule } from '@angular/core';
16
- import { NgZone } from '@angular/core';
17
- import { Pipe } from '@angular/core';
18
- import { PlatformRef } from '@angular/core';
19
- import { ProviderToken } from '@angular/core';
20
- import { SchemaMetadata } from '@angular/core';
21
- import { Type } from '@angular/core';
22
-
23
- /**
24
- * This API should be removed. But doing so seems to break `google3` and so it requires a bit of
25
- * investigation.
26
- *
27
- * A work around is to mark it as `@codeGenApi` for now and investigate later.
28
- *
29
- * @codeGenApi
30
- */
31
- export declare const __core_private_testing_placeholder__ = "";
32
-
33
- /**
34
- * @deprecated use `waitForAsync()`, (expected removal in v12)
35
- * @see {@link waitForAsync}
36
- * @publicApi
37
- * */
38
- export declare function async(fn: Function): (done: any) => any;
39
-
40
- /**
41
- * Fixture for debugging and testing a component.
42
- *
43
- * @publicApi
44
- */
45
- export declare class ComponentFixture<T> {
46
- componentRef: ComponentRef<T>;
47
- ngZone: NgZone | null;
48
- private _autoDetect;
49
- /**
50
- * The DebugElement associated with the root element of this component.
51
- */
52
- debugElement: DebugElement;
53
- /**
54
- * The instance of the root component class.
55
- */
56
- componentInstance: T;
57
- /**
58
- * The native element at the root of the component.
59
- */
60
- nativeElement: any;
61
- /**
62
- * The ElementRef for the element at the root of the component.
63
- */
64
- elementRef: ElementRef;
65
- /**
66
- * The ChangeDetectorRef for the component
67
- */
68
- changeDetectorRef: ChangeDetectorRef;
69
- private _renderer;
70
- private _isStable;
71
- private _isDestroyed;
72
- private _resolve;
73
- private _promise;
74
- private _onUnstableSubscription;
75
- private _onStableSubscription;
76
- private _onMicrotaskEmptySubscription;
77
- private _onErrorSubscription;
78
- constructor(componentRef: ComponentRef<T>, ngZone: NgZone | null, _autoDetect: boolean);
79
- private _tick;
80
- /**
81
- * Trigger a change detection cycle for the component.
82
- */
83
- detectChanges(checkNoChanges?: boolean): void;
84
- /**
85
- * Do a change detection run to make sure there were no changes.
86
- */
87
- checkNoChanges(): void;
88
- /**
89
- * Set whether the fixture should autodetect changes.
90
- *
91
- * Also runs detectChanges once so that any existing change is detected.
92
- */
93
- autoDetectChanges(autoDetect?: boolean): void;
94
- /**
95
- * Return whether the fixture is currently stable or has async tasks that have not been completed
96
- * yet.
97
- */
98
- isStable(): boolean;
99
- /**
100
- * Get a promise that resolves when the fixture is stable.
101
- *
102
- * This can be used to resume testing after events have triggered asynchronous activity or
103
- * asynchronous change detection.
104
- */
105
- whenStable(): Promise<any>;
106
- private _getRenderer;
107
- /**
108
- * Get a promise that resolves when the ui state is stable following animations.
109
- */
110
- whenRenderingDone(): Promise<any>;
111
- /**
112
- * Trigger component destruction.
113
- */
114
- destroy(): void;
115
- }
116
-
117
- /**
118
- * @publicApi
119
- */
120
- export declare const ComponentFixtureAutoDetect: InjectionToken<boolean[]>;
121
-
122
- /**
123
- * @publicApi
124
- */
125
- export declare const ComponentFixtureNoNgZone: InjectionToken<boolean[]>;
126
-
127
- /**
128
- * Discard all remaining periodic tasks.
129
- *
130
- * @publicApi
131
- */
132
- export declare function discardPeriodicTasks(): void;
133
-
134
- /**
135
- * Wraps a function to be executed in the `fakeAsync` zone:
136
- * - Microtasks are manually executed by calling `flushMicrotasks()`.
137
- * - Timers are synchronous; `tick()` simulates the asynchronous passage of time.
138
- *
139
- * If there are any pending timers at the end of the function, an exception is thrown.
140
- *
141
- * Can be used to wrap `inject()` calls.
142
- *
143
- * @param fn The function that you want to wrap in the `fakeAysnc` zone.
144
- *
145
- * @usageNotes
146
- * ### Example
147
- *
148
- * {@example core/testing/ts/fake_async.ts region='basic'}
149
- *
150
- *
151
- * @returns The function wrapped to be executed in the `fakeAsync` zone.
152
- * Any arguments passed when calling this returned function will be passed through to the `fn`
153
- * function in the parameters when it is called.
154
- *
155
- * @publicApi
156
- */
157
- export declare function fakeAsync(fn: Function): (...args: any[]) => any;
158
-
159
- /**
160
- * Flushes any pending microtasks and simulates the asynchronous passage of time for the timers in
161
- * the `fakeAsync` zone by
162
- * draining the macrotask queue until it is empty.
163
- *
164
- * @param maxTurns The maximum number of times the scheduler attempts to clear its queue before
165
- * throwing an error.
166
- * @returns The simulated time elapsed, in milliseconds.
167
- *
168
- * @publicApi
169
- */
170
- export declare function flush(maxTurns?: number): number;
171
-
172
- /**
173
- * Flush any pending microtasks.
174
- *
175
- * @publicApi
176
- */
177
- export declare function flushMicrotasks(): void;
178
-
179
- /**
180
- * Returns a singleton of the applicable `TestBed`.
181
- *
182
- * It will be either an instance of `TestBedViewEngine` or `TestBedRender3`.
183
- *
184
- * @publicApi
185
- */
186
- export declare const getTestBed: () => TestBed;
187
-
188
- /**
189
- * Allows injecting dependencies in `beforeEach()` and `it()`.
190
- *
191
- * Example:
192
- *
193
- * ```
194
- * beforeEach(inject([Dependency, AClass], (dep, object) => {
195
- * // some code that uses `dep` and `object`
196
- * // ...
197
- * }));
198
- *
199
- * it('...', inject([AClass], (object) => {
200
- * object.doSomething();
201
- * expect(...);
202
- * })
203
- * ```
204
- *
205
- * @publicApi
206
- */
207
- export declare function inject(tokens: any[], fn: Function): () => any;
208
-
209
- /**
210
- * @publicApi
211
- */
212
- export declare class InjectSetupWrapper {
213
- private _moduleDef;
214
- constructor(_moduleDef: () => TestModuleMetadata);
215
- private _addModule;
216
- inject(tokens: any[], fn: Function): () => any;
217
- }
218
-
219
-
220
- /**
221
- * Type used for modifications to metadata
222
- *
223
- * @publicApi
224
- */
225
- export declare type MetadataOverride<T> = {
226
- add?: Partial<T>;
227
- remove?: Partial<T>;
228
- set?: Partial<T>;
229
- };
230
-
231
- /**
232
- * Configures the test module teardown behavior in `TestBed`.
233
- * @publicApi
234
- */
235
- export declare interface ModuleTeardownOptions {
236
- /** Whether the test module should be destroyed after every test. */
237
- destroyAfterEach: boolean;
238
- /** Whether errors during test module destruction should be re-thrown. Defaults to `true`. */
239
- rethrowErrors?: boolean;
240
- }
241
-
242
- /**
243
- * Clears out the shared fake async zone for a test.
244
- * To be called in a global `beforeEach`.
245
- *
246
- * @publicApi
247
- */
248
- export declare function resetFakeAsyncZone(): void;
249
-
250
- /**
251
- * @publicApi
252
- */
253
- export declare interface TestBed {
254
- platform: PlatformRef;
255
- ngModule: Type<any> | Type<any>[];
256
- /**
257
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
258
- * angular module. These are common to every test in the suite.
259
- *
260
- * This may only be called once, to set up the common providers for the current test
261
- * suite on the current platform. If you absolutely need to change the providers,
262
- * first use `resetTestEnvironment`.
263
- *
264
- * Test modules and platforms for individual platforms are available from
265
- * '@angular/<platform_name>/testing'.
266
- */
267
- initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, options?: TestEnvironmentOptions): void;
268
- /**
269
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
270
- * angular module. These are common to every test in the suite.
271
- *
272
- * This may only be called once, to set up the common providers for the current test
273
- * suite on the current platform. If you absolutely need to change the providers,
274
- * first use `resetTestEnvironment`.
275
- *
276
- * Test modules and platforms for individual platforms are available from
277
- * '@angular/<platform_name>/testing'.
278
- *
279
- * @deprecated This API that allows providing AOT summaries is deprecated, since summary files are
280
- * unused in Ivy.
281
- */
282
- initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
283
- /**
284
- * Reset the providers for the test injector.
285
- */
286
- resetTestEnvironment(): void;
287
- resetTestingModule(): void;
288
- configureCompiler(config: {
289
- providers?: any[];
290
- useJit?: boolean;
291
- }): void;
292
- configureTestingModule(moduleDef: TestModuleMetadata): void;
293
- compileComponents(): Promise<any>;
294
- inject<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
295
- inject<T>(token: ProviderToken<T>, notFoundValue: null, flags?: InjectFlags): T | null;
296
- /** @deprecated from v9.0.0 use TestBed.inject */
297
- get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
298
- /** @deprecated from v9.0.0 use TestBed.inject */
299
- get(token: any, notFoundValue?: any): any;
300
- execute(tokens: any[], fn: Function, context?: any): any;
301
- overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void;
302
- overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;
303
- overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;
304
- overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void;
305
- /**
306
- * Overwrites all providers for the given token with the given provider definition.
307
- */
308
- overrideProvider(token: any, provider: {
309
- useFactory: Function;
310
- deps: any[];
311
- }): void;
312
- overrideProvider(token: any, provider: {
313
- useValue: any;
314
- }): void;
315
- overrideProvider(token: any, provider: {
316
- useFactory?: Function;
317
- useValue?: any;
318
- deps?: any[];
319
- }): void;
320
- overrideTemplateUsingTestingModule(component: Type<any>, template: string): void;
321
- createComponent<T>(component: Type<T>): ComponentFixture<T>;
322
- }
323
-
324
- /**
325
- * @description
326
- * Configures and initializes environment for unit testing and provides methods for
327
- * creating components and services in unit tests.
328
- *
329
- * `TestBed` is the primary api for writing unit tests for Angular applications and libraries.
330
- *
331
- * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3`
332
- * according to the compiler used.
333
- *
334
- * @publicApi
335
- */
336
- export declare const TestBed: TestBedStatic;
337
-
338
- /**
339
- * Static methods implemented by the `TestBedViewEngine` and `TestBedRender3`
340
- *
341
- * @publicApi
342
- */
343
- export declare interface TestBedStatic {
344
- new (...args: any[]): TestBed;
345
- /**
346
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
347
- * angular module. These are common to every test in the suite.
348
- *
349
- * This may only be called once, to set up the common providers for the current test
350
- * suite on the current platform. If you absolutely need to change the providers,
351
- * first use `resetTestEnvironment`.
352
- *
353
- * Test modules and platforms for individual platforms are available from
354
- * '@angular/<platform_name>/testing'.
355
- */
356
- initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, options?: TestEnvironmentOptions): TestBed;
357
- /**
358
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
359
- * angular module. These are common to every test in the suite.
360
- *
361
- * This may only be called once, to set up the common providers for the current test
362
- * suite on the current platform. If you absolutely need to change the providers,
363
- * first use `resetTestEnvironment`.
364
- *
365
- * Test modules and platforms for individual platforms are available from
366
- * '@angular/<platform_name>/testing'.
367
- *
368
- * @deprecated This API that allows providing AOT summaries is deprecated, since summary files are
369
- * unused in Ivy.
370
- */
371
- initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed;
372
- /**
373
- * Reset the providers for the test injector.
374
- */
375
- resetTestEnvironment(): void;
376
- resetTestingModule(): TestBedStatic;
377
- /**
378
- * Allows overriding default compiler providers and settings
379
- * which are defined in test_injector.js
380
- */
381
- configureCompiler(config: {
382
- providers?: any[];
383
- useJit?: boolean;
384
- }): TestBedStatic;
385
- /**
386
- * Allows overriding default providers, directives, pipes, modules of the test injector,
387
- * which are defined in test_injector.js
388
- */
389
- configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic;
390
- /**
391
- * Compile components with a `templateUrl` for the test's NgModule.
392
- * It is necessary to call this function
393
- * as fetching urls is asynchronous.
394
- */
395
- compileComponents(): Promise<any>;
396
- overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic;
397
- overrideComponent(component: Type<any>, override: MetadataOverride<Component>): TestBedStatic;
398
- overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): TestBedStatic;
399
- overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic;
400
- overrideTemplate(component: Type<any>, template: string): TestBedStatic;
401
- /**
402
- * Overrides the template of the given component, compiling the template
403
- * in the context of the TestingModule.
404
- *
405
- * Note: This works for JIT and AOTed components as well.
406
- */
407
- overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic;
408
- /**
409
- * Overwrites all providers for the given token with the given provider definition.
410
- *
411
- * Note: This works for JIT and AOTed components as well.
412
- */
413
- overrideProvider(token: any, provider: {
414
- useFactory: Function;
415
- deps: any[];
416
- }): TestBedStatic;
417
- overrideProvider(token: any, provider: {
418
- useValue: any;
419
- }): TestBedStatic;
420
- overrideProvider(token: any, provider: {
421
- useFactory?: Function;
422
- useValue?: any;
423
- deps?: any[];
424
- }): TestBedStatic;
425
- inject<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
426
- inject<T>(token: ProviderToken<T>, notFoundValue: null, flags?: InjectFlags): T | null;
427
- /** @deprecated from v9.0.0 use TestBed.inject */
428
- get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
429
- /** @deprecated from v9.0.0 use TestBed.inject */
430
- get(token: any, notFoundValue?: any): any;
431
- createComponent<T>(component: Type<T>): ComponentFixture<T>;
432
- }
433
-
434
- /**
435
- * An abstract class for inserting the root test component element in a platform independent way.
436
- *
437
- * @publicApi
438
- */
439
- export declare class TestComponentRenderer {
440
- insertRootElement(rootElementId: string): void;
441
- removeAllRootElements?(): void;
442
- }
443
-
444
- /**
445
- * @publicApi
446
- */
447
- export declare interface TestEnvironmentOptions {
448
- /**
449
- * Provides a way to specify AOT summaries to use in TestBed.
450
- * This parameter is unused and deprecated in Ivy.
451
- *
452
- * @deprecated With Ivy, AOT summary files are unused.
453
- */
454
- aotSummaries?: () => any[];
455
- /**
456
- * Configures the test module teardown behavior in `TestBed`.
457
- */
458
- teardown?: ModuleTeardownOptions;
459
- }
460
-
461
- /**
462
- * @publicApi
463
- */
464
- export declare type TestModuleMetadata = {
465
- providers?: any[];
466
- declarations?: any[];
467
- imports?: any[];
468
- schemas?: Array<SchemaMetadata | any[]>;
469
- /**
470
- * @deprecated With Ivy, AOT summary files are unused.
471
- */
472
- aotSummaries?: () => any[];
473
- teardown?: ModuleTeardownOptions;
474
- };
475
-
476
- /**
477
- * Simulates the asynchronous passage of time for the timers in the `fakeAsync` zone.
478
- *
479
- * The microtasks queue is drained at the very start of this function and after any timer callback
480
- * has been executed.
481
- *
482
- * @param millis The number of milliseconds to advance the virtual timer.
483
- * @param tickOptions The options to pass to the `tick()` function.
484
- *
485
- * @usageNotes
486
- *
487
- * The `tick()` option is a flag called `processNewMacroTasksSynchronously`,
488
- * which determines whether or not to invoke new macroTasks.
489
- *
490
- * If you provide a `tickOptions` object, but do not specify a
491
- * `processNewMacroTasksSynchronously` property (`tick(100, {})`),
492
- * then `processNewMacroTasksSynchronously` defaults to true.
493
- *
494
- * If you omit the `tickOptions` parameter (`tick(100))`), then
495
- * `tickOptions` defaults to `{processNewMacroTasksSynchronously: true}`.
496
- *
497
- * ### Example
498
- *
499
- * {@example core/testing/ts/fake_async.ts region='basic'}
500
- *
501
- * The following example includes a nested timeout (new macroTask), and
502
- * the `tickOptions` parameter is allowed to default. In this case,
503
- * `processNewMacroTasksSynchronously` defaults to true, and the nested
504
- * function is executed on each tick.
505
- *
506
- * ```
507
- * it ('test with nested setTimeout', fakeAsync(() => {
508
- * let nestedTimeoutInvoked = false;
509
- * function funcWithNestedTimeout() {
510
- * setTimeout(() => {
511
- * nestedTimeoutInvoked = true;
512
- * });
513
- * };
514
- * setTimeout(funcWithNestedTimeout);
515
- * tick();
516
- * expect(nestedTimeoutInvoked).toBe(true);
517
- * }));
518
- * ```
519
- *
520
- * In the following case, `processNewMacroTasksSynchronously` is explicitly
521
- * set to false, so the nested timeout function is not invoked.
522
- *
523
- * ```
524
- * it ('test with nested setTimeout', fakeAsync(() => {
525
- * let nestedTimeoutInvoked = false;
526
- * function funcWithNestedTimeout() {
527
- * setTimeout(() => {
528
- * nestedTimeoutInvoked = true;
529
- * });
530
- * };
531
- * setTimeout(funcWithNestedTimeout);
532
- * tick(0, {processNewMacroTasksSynchronously: false});
533
- * expect(nestedTimeoutInvoked).toBe(false);
534
- * }));
535
- * ```
536
- *
537
- *
538
- * @publicApi
539
- */
540
- export declare function tick(millis?: number, tickOptions?: {
541
- processNewMacroTasksSynchronously: boolean;
542
- }): void;
543
-
544
-
545
- /**
546
- * Wraps a test function in an asynchronous test zone. The test will automatically
547
- * complete when all asynchronous calls within this zone are done. Can be used
548
- * to wrap an {@link inject} call.
549
- *
550
- * Example:
551
- *
552
- * ```
553
- * it('...', waitForAsync(inject([AClass], (object) => {
554
- * object.doSomething.then(() => {
555
- * expect(...);
556
- * })
557
- * });
558
- * ```
559
- *
560
- * @publicApi
561
- */
562
- export declare function waitForAsync(fn: Function): (done: any) => any;
563
-
564
- /**
565
- * @publicApi
566
- */
567
- export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
568
-
569
- export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;
570
-
571
- export declare class ɵMetadataOverrider {
572
- private _references;
573
- /**
574
- * Creates a new instance for the given metadata class
575
- * based on an old instance and overrides.
576
- */
577
- overrideMetadata<C extends T, T>(metadataClass: {
578
- new (options: T): C;
579
- }, oldMetadata: C, override: MetadataOverride<T>): C;
580
- }
581
-
582
- export { }
7
+
8
+ import { ChangeDetectorRef } from '@angular/core';
9
+ import { Component } from '@angular/core';
10
+ import { ComponentRef } from '@angular/core';
11
+ import { DebugElement } from '@angular/core';
12
+ import { Directive } from '@angular/core';
13
+ import { ElementRef } from '@angular/core';
14
+ import { InjectFlags } from '@angular/core';
15
+ import { InjectionToken } from '@angular/core';
16
+ import { NgModule } from '@angular/core';
17
+ import { NgZone } from '@angular/core';
18
+ import { Pipe } from '@angular/core';
19
+ import { PlatformRef } from '@angular/core';
20
+ import { ProviderToken } from '@angular/core';
21
+ import { SchemaMetadata } from '@angular/core';
22
+ import { Type } from '@angular/core';
23
+
24
+ /**
25
+ * This API should be removed. But doing so seems to break `google3` and so it requires a bit of
26
+ * investigation.
27
+ *
28
+ * A work around is to mark it as `@codeGenApi` for now and investigate later.
29
+ *
30
+ * @codeGenApi
31
+ */
32
+ export declare const __core_private_testing_placeholder__ = "";
33
+
34
+ /**
35
+ * @deprecated use `waitForAsync()`, (expected removal in v12)
36
+ * @see {@link waitForAsync}
37
+ * @publicApi
38
+ * */
39
+ export declare function async(fn: Function): (done: any) => any;
40
+
41
+ /**
42
+ * Fixture for debugging and testing a component.
43
+ *
44
+ * @publicApi
45
+ */
46
+ export declare class ComponentFixture<T> {
47
+ componentRef: ComponentRef<T>;
48
+ ngZone: NgZone | null;
49
+ private _autoDetect;
50
+ /**
51
+ * The DebugElement associated with the root element of this component.
52
+ */
53
+ debugElement: DebugElement;
54
+ /**
55
+ * The instance of the root component class.
56
+ */
57
+ componentInstance: T;
58
+ /**
59
+ * The native element at the root of the component.
60
+ */
61
+ nativeElement: any;
62
+ /**
63
+ * The ElementRef for the element at the root of the component.
64
+ */
65
+ elementRef: ElementRef;
66
+ /**
67
+ * The ChangeDetectorRef for the component
68
+ */
69
+ changeDetectorRef: ChangeDetectorRef;
70
+ private _renderer;
71
+ private _isStable;
72
+ private _isDestroyed;
73
+ private _resolve;
74
+ private _promise;
75
+ private _onUnstableSubscription;
76
+ private _onStableSubscription;
77
+ private _onMicrotaskEmptySubscription;
78
+ private _onErrorSubscription;
79
+ constructor(componentRef: ComponentRef<T>, ngZone: NgZone | null, _autoDetect: boolean);
80
+ private _tick;
81
+ /**
82
+ * Trigger a change detection cycle for the component.
83
+ */
84
+ detectChanges(checkNoChanges?: boolean): void;
85
+ /**
86
+ * Do a change detection run to make sure there were no changes.
87
+ */
88
+ checkNoChanges(): void;
89
+ /**
90
+ * Set whether the fixture should autodetect changes.
91
+ *
92
+ * Also runs detectChanges once so that any existing change is detected.
93
+ */
94
+ autoDetectChanges(autoDetect?: boolean): void;
95
+ /**
96
+ * Return whether the fixture is currently stable or has async tasks that have not been completed
97
+ * yet.
98
+ */
99
+ isStable(): boolean;
100
+ /**
101
+ * Get a promise that resolves when the fixture is stable.
102
+ *
103
+ * This can be used to resume testing after events have triggered asynchronous activity or
104
+ * asynchronous change detection.
105
+ */
106
+ whenStable(): Promise<any>;
107
+ private _getRenderer;
108
+ /**
109
+ * Get a promise that resolves when the ui state is stable following animations.
110
+ */
111
+ whenRenderingDone(): Promise<any>;
112
+ /**
113
+ * Trigger component destruction.
114
+ */
115
+ destroy(): void;
116
+ }
117
+
118
+ /**
119
+ * @publicApi
120
+ */
121
+ export declare const ComponentFixtureAutoDetect: InjectionToken<boolean[]>;
122
+
123
+ /**
124
+ * @publicApi
125
+ */
126
+ export declare const ComponentFixtureNoNgZone: InjectionToken<boolean[]>;
127
+
128
+ /**
129
+ * Discard all remaining periodic tasks.
130
+ *
131
+ * @publicApi
132
+ */
133
+ export declare function discardPeriodicTasks(): void;
134
+
135
+ /**
136
+ * Wraps a function to be executed in the `fakeAsync` zone:
137
+ * - Microtasks are manually executed by calling `flushMicrotasks()`.
138
+ * - Timers are synchronous; `tick()` simulates the asynchronous passage of time.
139
+ *
140
+ * If there are any pending timers at the end of the function, an exception is thrown.
141
+ *
142
+ * Can be used to wrap `inject()` calls.
143
+ *
144
+ * @param fn The function that you want to wrap in the `fakeAysnc` zone.
145
+ *
146
+ * @usageNotes
147
+ * ### Example
148
+ *
149
+ * {@example core/testing/ts/fake_async.ts region='basic'}
150
+ *
151
+ *
152
+ * @returns The function wrapped to be executed in the `fakeAsync` zone.
153
+ * Any arguments passed when calling this returned function will be passed through to the `fn`
154
+ * function in the parameters when it is called.
155
+ *
156
+ * @publicApi
157
+ */
158
+ export declare function fakeAsync(fn: Function): (...args: any[]) => any;
159
+
160
+ /**
161
+ * Flushes any pending microtasks and simulates the asynchronous passage of time for the timers in
162
+ * the `fakeAsync` zone by
163
+ * draining the macrotask queue until it is empty.
164
+ *
165
+ * @param maxTurns The maximum number of times the scheduler attempts to clear its queue before
166
+ * throwing an error.
167
+ * @returns The simulated time elapsed, in milliseconds.
168
+ *
169
+ * @publicApi
170
+ */
171
+ export declare function flush(maxTurns?: number): number;
172
+
173
+ /**
174
+ * Flush any pending microtasks.
175
+ *
176
+ * @publicApi
177
+ */
178
+ export declare function flushMicrotasks(): void;
179
+
180
+ /**
181
+ * Returns a singleton of the applicable `TestBed`.
182
+ *
183
+ * It will be either an instance of `TestBedViewEngine` or `TestBedRender3`.
184
+ *
185
+ * @publicApi
186
+ */
187
+ export declare const getTestBed: () => TestBed;
188
+
189
+ /**
190
+ * Allows injecting dependencies in `beforeEach()` and `it()`.
191
+ *
192
+ * Example:
193
+ *
194
+ * ```
195
+ * beforeEach(inject([Dependency, AClass], (dep, object) => {
196
+ * // some code that uses `dep` and `object`
197
+ * // ...
198
+ * }));
199
+ *
200
+ * it('...', inject([AClass], (object) => {
201
+ * object.doSomething();
202
+ * expect(...);
203
+ * })
204
+ * ```
205
+ *
206
+ * @publicApi
207
+ */
208
+ export declare function inject(tokens: any[], fn: Function): () => any;
209
+
210
+ /**
211
+ * @publicApi
212
+ */
213
+ export declare class InjectSetupWrapper {
214
+ private _moduleDef;
215
+ constructor(_moduleDef: () => TestModuleMetadata);
216
+ private _addModule;
217
+ inject(tokens: any[], fn: Function): () => any;
218
+ }
219
+
220
+
221
+ /**
222
+ * Type used for modifications to metadata
223
+ *
224
+ * @publicApi
225
+ */
226
+ export declare type MetadataOverride<T> = {
227
+ add?: Partial<T>;
228
+ remove?: Partial<T>;
229
+ set?: Partial<T>;
230
+ };
231
+
232
+ /**
233
+ * Configures the test module teardown behavior in `TestBed`.
234
+ * @publicApi
235
+ */
236
+ export declare interface ModuleTeardownOptions {
237
+ /** Whether the test module should be destroyed after every test. */
238
+ destroyAfterEach: boolean;
239
+ /** Whether errors during test module destruction should be re-thrown. Defaults to `true`. */
240
+ rethrowErrors?: boolean;
241
+ }
242
+
243
+ /**
244
+ * Clears out the shared fake async zone for a test.
245
+ * To be called in a global `beforeEach`.
246
+ *
247
+ * @publicApi
248
+ */
249
+ export declare function resetFakeAsyncZone(): void;
250
+
251
+ /**
252
+ * @publicApi
253
+ */
254
+ export declare interface TestBed {
255
+ platform: PlatformRef;
256
+ ngModule: Type<any> | Type<any>[];
257
+ /**
258
+ * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
259
+ * angular module. These are common to every test in the suite.
260
+ *
261
+ * This may only be called once, to set up the common providers for the current test
262
+ * suite on the current platform. If you absolutely need to change the providers,
263
+ * first use `resetTestEnvironment`.
264
+ *
265
+ * Test modules and platforms for individual platforms are available from
266
+ * '@angular/<platform_name>/testing'.
267
+ */
268
+ initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, options?: TestEnvironmentOptions): void;
269
+ /**
270
+ * Reset the providers for the test injector.
271
+ */
272
+ resetTestEnvironment(): void;
273
+ resetTestingModule(): void;
274
+ configureCompiler(config: {
275
+ providers?: any[];
276
+ useJit?: boolean;
277
+ }): void;
278
+ configureTestingModule(moduleDef: TestModuleMetadata): void;
279
+ compileComponents(): Promise<any>;
280
+ inject<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
281
+ inject<T>(token: ProviderToken<T>, notFoundValue: null, flags?: InjectFlags): T | null;
282
+ /** @deprecated from v9.0.0 use TestBed.inject */
283
+ get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
284
+ /** @deprecated from v9.0.0 use TestBed.inject */
285
+ get(token: any, notFoundValue?: any): any;
286
+ execute(tokens: any[], fn: Function, context?: any): any;
287
+ overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void;
288
+ overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;
289
+ overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;
290
+ overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void;
291
+ /**
292
+ * Overwrites all providers for the given token with the given provider definition.
293
+ */
294
+ overrideProvider(token: any, provider: {
295
+ useFactory: Function;
296
+ deps: any[];
297
+ }): void;
298
+ overrideProvider(token: any, provider: {
299
+ useValue: any;
300
+ }): void;
301
+ overrideProvider(token: any, provider: {
302
+ useFactory?: Function;
303
+ useValue?: any;
304
+ deps?: any[];
305
+ }): void;
306
+ overrideTemplateUsingTestingModule(component: Type<any>, template: string): void;
307
+ createComponent<T>(component: Type<T>): ComponentFixture<T>;
308
+ }
309
+
310
+ /**
311
+ * @description
312
+ * Configures and initializes environment for unit testing and provides methods for
313
+ * creating components and services in unit tests.
314
+ *
315
+ * `TestBed` is the primary api for writing unit tests for Angular applications and libraries.
316
+ *
317
+ * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3`
318
+ * according to the compiler used.
319
+ *
320
+ * @publicApi
321
+ */
322
+ export declare const TestBed: TestBedStatic;
323
+
324
+ /**
325
+ * Static methods implemented by the `TestBedViewEngine` and `TestBedRender3`
326
+ *
327
+ * @publicApi
328
+ */
329
+ export declare interface TestBedStatic {
330
+ new (...args: any[]): TestBed;
331
+ /**
332
+ * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
333
+ * angular module. These are common to every test in the suite.
334
+ *
335
+ * This may only be called once, to set up the common providers for the current test
336
+ * suite on the current platform. If you absolutely need to change the providers,
337
+ * first use `resetTestEnvironment`.
338
+ *
339
+ * Test modules and platforms for individual platforms are available from
340
+ * '@angular/<platform_name>/testing'.
341
+ */
342
+ initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, options?: TestEnvironmentOptions): TestBed;
343
+ /**
344
+ * Reset the providers for the test injector.
345
+ */
346
+ resetTestEnvironment(): void;
347
+ resetTestingModule(): TestBedStatic;
348
+ /**
349
+ * Allows overriding default compiler providers and settings
350
+ * which are defined in test_injector.js
351
+ */
352
+ configureCompiler(config: {
353
+ providers?: any[];
354
+ useJit?: boolean;
355
+ }): TestBedStatic;
356
+ /**
357
+ * Allows overriding default providers, directives, pipes, modules of the test injector,
358
+ * which are defined in test_injector.js
359
+ */
360
+ configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic;
361
+ /**
362
+ * Compile components with a `templateUrl` for the test's NgModule.
363
+ * It is necessary to call this function
364
+ * as fetching urls is asynchronous.
365
+ */
366
+ compileComponents(): Promise<any>;
367
+ overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic;
368
+ overrideComponent(component: Type<any>, override: MetadataOverride<Component>): TestBedStatic;
369
+ overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): TestBedStatic;
370
+ overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic;
371
+ overrideTemplate(component: Type<any>, template: string): TestBedStatic;
372
+ /**
373
+ * Overrides the template of the given component, compiling the template
374
+ * in the context of the TestingModule.
375
+ *
376
+ * Note: This works for JIT and AOTed components as well.
377
+ */
378
+ overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic;
379
+ /**
380
+ * Overwrites all providers for the given token with the given provider definition.
381
+ *
382
+ * Note: This works for JIT and AOTed components as well.
383
+ */
384
+ overrideProvider(token: any, provider: {
385
+ useFactory: Function;
386
+ deps: any[];
387
+ }): TestBedStatic;
388
+ overrideProvider(token: any, provider: {
389
+ useValue: any;
390
+ }): TestBedStatic;
391
+ overrideProvider(token: any, provider: {
392
+ useFactory?: Function;
393
+ useValue?: any;
394
+ deps?: any[];
395
+ }): TestBedStatic;
396
+ inject<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
397
+ inject<T>(token: ProviderToken<T>, notFoundValue: null, flags?: InjectFlags): T | null;
398
+ /** @deprecated from v9.0.0 use TestBed.inject */
399
+ get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
400
+ /** @deprecated from v9.0.0 use TestBed.inject */
401
+ get(token: any, notFoundValue?: any): any;
402
+ createComponent<T>(component: Type<T>): ComponentFixture<T>;
403
+ }
404
+
405
+ /**
406
+ * An abstract class for inserting the root test component element in a platform independent way.
407
+ *
408
+ * @publicApi
409
+ */
410
+ export declare class TestComponentRenderer {
411
+ insertRootElement(rootElementId: string): void;
412
+ removeAllRootElements?(): void;
413
+ }
414
+
415
+ /**
416
+ * @publicApi
417
+ */
418
+ export declare interface TestEnvironmentOptions {
419
+ /**
420
+ * Configures the test module teardown behavior in `TestBed`.
421
+ */
422
+ teardown?: ModuleTeardownOptions;
423
+ /**
424
+ * Whether errors should be thrown when unknown elements are present in component's template.
425
+ * Defaults to `false`, where the error is simply logged.
426
+ * If set to `true`, the error is thrown.
427
+ * @see https://angular.io/errors/NG8001 for the description of the error and how to fix it
428
+ */
429
+ errorOnUnknownElements?: boolean;
430
+ /**
431
+ * Whether errors should be thrown when unknown properties are present in component's template.
432
+ * Defaults to `false`, where the error is simply logged.
433
+ * If set to `true`, the error is thrown.
434
+ * @see https://angular.io/errors/NG8002 for the description of the error and how to fix it
435
+ */
436
+ errorOnUnknownProperties?: boolean;
437
+ }
438
+
439
+ /**
440
+ * @publicApi
441
+ */
442
+ export declare interface TestModuleMetadata {
443
+ providers?: any[];
444
+ declarations?: any[];
445
+ imports?: any[];
446
+ schemas?: Array<SchemaMetadata | any[]>;
447
+ teardown?: ModuleTeardownOptions;
448
+ /**
449
+ * Whether NG0304 runtime errors should be thrown when unknown elements are present in component's
450
+ * template. Defaults to `false`, where the error is simply logged. If set to `true`, the error is
451
+ * thrown.
452
+ * @see https://angular.io/errors/NG8001 for the description of the problem and how to fix it
453
+ */
454
+ errorOnUnknownElements?: boolean;
455
+ /**
456
+ * Whether errors should be thrown when unknown properties are present in component's template.
457
+ * Defaults to `false`, where the error is simply logged.
458
+ * If set to `true`, the error is thrown.
459
+ * @see https://angular.io/errors/NG8002 for the description of the error and how to fix it
460
+ */
461
+ errorOnUnknownProperties?: boolean;
462
+ }
463
+
464
+ /**
465
+ * Simulates the asynchronous passage of time for the timers in the `fakeAsync` zone.
466
+ *
467
+ * The microtasks queue is drained at the very start of this function and after any timer callback
468
+ * has been executed.
469
+ *
470
+ * @param millis The number of milliseconds to advance the virtual timer.
471
+ * @param tickOptions The options to pass to the `tick()` function.
472
+ *
473
+ * @usageNotes
474
+ *
475
+ * The `tick()` option is a flag called `processNewMacroTasksSynchronously`,
476
+ * which determines whether or not to invoke new macroTasks.
477
+ *
478
+ * If you provide a `tickOptions` object, but do not specify a
479
+ * `processNewMacroTasksSynchronously` property (`tick(100, {})`),
480
+ * then `processNewMacroTasksSynchronously` defaults to true.
481
+ *
482
+ * If you omit the `tickOptions` parameter (`tick(100))`), then
483
+ * `tickOptions` defaults to `{processNewMacroTasksSynchronously: true}`.
484
+ *
485
+ * ### Example
486
+ *
487
+ * {@example core/testing/ts/fake_async.ts region='basic'}
488
+ *
489
+ * The following example includes a nested timeout (new macroTask), and
490
+ * the `tickOptions` parameter is allowed to default. In this case,
491
+ * `processNewMacroTasksSynchronously` defaults to true, and the nested
492
+ * function is executed on each tick.
493
+ *
494
+ * ```
495
+ * it ('test with nested setTimeout', fakeAsync(() => {
496
+ * let nestedTimeoutInvoked = false;
497
+ * function funcWithNestedTimeout() {
498
+ * setTimeout(() => {
499
+ * nestedTimeoutInvoked = true;
500
+ * });
501
+ * };
502
+ * setTimeout(funcWithNestedTimeout);
503
+ * tick();
504
+ * expect(nestedTimeoutInvoked).toBe(true);
505
+ * }));
506
+ * ```
507
+ *
508
+ * In the following case, `processNewMacroTasksSynchronously` is explicitly
509
+ * set to false, so the nested timeout function is not invoked.
510
+ *
511
+ * ```
512
+ * it ('test with nested setTimeout', fakeAsync(() => {
513
+ * let nestedTimeoutInvoked = false;
514
+ * function funcWithNestedTimeout() {
515
+ * setTimeout(() => {
516
+ * nestedTimeoutInvoked = true;
517
+ * });
518
+ * };
519
+ * setTimeout(funcWithNestedTimeout);
520
+ * tick(0, {processNewMacroTasksSynchronously: false});
521
+ * expect(nestedTimeoutInvoked).toBe(false);
522
+ * }));
523
+ * ```
524
+ *
525
+ *
526
+ * @publicApi
527
+ */
528
+ export declare function tick(millis?: number, tickOptions?: {
529
+ processNewMacroTasksSynchronously: boolean;
530
+ }): void;
531
+
532
+
533
+ /**
534
+ * Wraps a test function in an asynchronous test zone. The test will automatically
535
+ * complete when all asynchronous calls within this zone are done. Can be used
536
+ * to wrap an {@link inject} call.
537
+ *
538
+ * Example:
539
+ *
540
+ * ```
541
+ * it('...', waitForAsync(inject([AClass], (object) => {
542
+ * object.doSomething.then(() => {
543
+ * expect(...);
544
+ * })
545
+ * });
546
+ * ```
547
+ *
548
+ * @publicApi
549
+ */
550
+ export declare function waitForAsync(fn: Function): (done: any) => any;
551
+
552
+ /**
553
+ * @publicApi
554
+ */
555
+ export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
556
+
557
+ export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;
558
+
559
+ export declare class ɵMetadataOverrider {
560
+ private _references;
561
+ /**
562
+ * Creates a new instance for the given metadata class
563
+ * based on an old instance and overrides.
564
+ */
565
+ overrideMetadata<C extends T, T>(metadataClass: {
566
+ new (options: T): C;
567
+ }, oldMetadata: C, override: MetadataOverride<T>): C;
568
+ }
569
+
570
+ export { }