blob: 03dc469b3539263e73ad1ad87196b9cbdd50f602 [file] [log] [blame]
{"version":3,"file":"testing.js","sources":["../../../../../../packages/core/testing/src/async_fallback.ts","../../../../../../packages/core/testing/src/async.ts","../../../../../../packages/core/testing/src/component_fixture.ts","../../../../../../packages/core/testing/src/fake_async_fallback.ts","../../../../../../packages/core/testing/src/fake_async.ts","../../../../../../packages/core/testing/src/async_test_completer.ts","../../../../../../packages/core/testing/src/test_bed_common.ts","../../../../../packages/core/src/metadata/resource_loading.ts","../../../../../../packages/core/testing/src/metadata_overrider.ts","../../../../../../packages/core/testing/src/resolvers.ts","../../../../../../packages/core/testing/src/r3_test_bed_compiler.ts","../../../../../../packages/core/testing/src/r3_test_bed.ts","../../../../../../packages/core/testing/src/test_compiler.ts","../../../../../../packages/core/testing/src/test_bed.ts","../../../../../../packages/core/testing/src/before_each.ts","../../../../../../packages/core/testing/src/private_export_testing.ts","../../../../../../packages/core/testing/src/testing.ts","../../../../../../packages/core/testing/public_api.ts","../../../../../../packages/core/testing/index.ts","../../../../../../packages/core/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * async has been moved to zone.js\n * this file is for fallback in case old version of zone.js is used\n */\ndeclare var global: any;\n\nconst _global = <any>(typeof window === 'undefined' ? global : window);\n\n/**\n * Wraps a test function in an asynchronous test zone. The test will automatically\n * complete when all asynchronous calls within this zone are done. Can be used\n * to wrap an {@link inject} call.\n *\n * Example:\n *\n * ```\n * it('...', async(inject([AClass], (object) => {\n * object.doSomething.then(() => {\n * expect(...);\n * })\n * });\n * ```\n *\n *\n */\nexport function asyncFallback(fn: Function): (done: any) => any {\n // If we're running using the Jasmine test framework, adapt to call the 'done'\n // function when asynchronous activity is finished.\n if (_global.jasmine) {\n // Not using an arrow function to preserve context passed from call site\n return function(done: any) {\n if (!done) {\n // if we run beforeEach in @angular/core/testing/testing_internal then we get no done\n // fake it here and assume sync.\n done = function() {};\n done.fail = function(e: any) { throw e; };\n }\n runInTestZone(fn, this, done, (err: any) => {\n if (typeof err === 'string') {\n return done.fail(new Error(<string>err));\n } else {\n done.fail(err);\n }\n });\n };\n }\n // Otherwise, return a promise which will resolve when asynchronous activity\n // is finished. This will be correctly consumed by the Mocha framework with\n // it('...', async(myFn)); or can be used in a custom framework.\n // Not using an arrow function to preserve context passed from call site\n return function() {\n return new Promise<void>((finishCallback, failCallback) => {\n runInTestZone(fn, this, finishCallback, failCallback);\n });\n };\n}\n\nfunction runInTestZone(\n fn: Function, context: any, finishCallback: Function, failCallback: Function) {\n const currentZone = Zone.current;\n const AsyncTestZoneSpec = (Zone as any)['AsyncTestZoneSpec'];\n if (AsyncTestZoneSpec === undefined) {\n throw new Error(\n 'AsyncTestZoneSpec is needed for the async() test helper but could not be found. ' +\n 'Please make sure that your environment includes zone.js/dist/async-test.js');\n }\n const ProxyZoneSpec = (Zone as any)['ProxyZoneSpec'] as {\n get(): {setDelegate(spec: ZoneSpec): void; getDelegate(): ZoneSpec;};\n assertPresent: () => void;\n };\n if (ProxyZoneSpec === undefined) {\n throw new Error(\n 'ProxyZoneSpec is needed for the async() test helper but could not be found. ' +\n 'Please make sure that your environment includes zone.js/dist/proxy.js');\n }\n const proxyZoneSpec = ProxyZoneSpec.get();\n ProxyZoneSpec.assertPresent();\n // We need to create the AsyncTestZoneSpec outside the ProxyZone.\n // If we do it in ProxyZone then we will get to infinite recursion.\n const proxyZone = Zone.current.getZoneWith('ProxyZoneSpec');\n const previousDelegate = proxyZoneSpec.getDelegate();\n proxyZone !.parent !.run(() => {\n const testZoneSpec: ZoneSpec = new AsyncTestZoneSpec(\n () => {\n // Need to restore the original zone.\n currentZone.run(() => {\n if (proxyZoneSpec.getDelegate() == testZoneSpec) {\n // Only reset the zone spec if it's sill this one. Otherwise, assume it's OK.\n proxyZoneSpec.setDelegate(previousDelegate);\n }\n finishCallback();\n });\n },\n (error: any) => {\n // Need to restore the original zone.\n currentZone.run(() => {\n if (proxyZoneSpec.getDelegate() == testZoneSpec) {\n // Only reset the zone spec if it's sill this one. Otherwise, assume it's OK.\n proxyZoneSpec.setDelegate(previousDelegate);\n }\n failCallback(error);\n });\n },\n 'test');\n proxyZoneSpec.setDelegate(testZoneSpec);\n });\n return Zone.current.runGuarded(fn, context);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {asyncFallback} from './async_fallback';\n\n/**\n * Wraps a test function in an asynchronous test zone. The test will automatically\n * complete when all asynchronous calls within this zone are done. Can be used\n * to wrap an {@link inject} call.\n *\n * Example:\n *\n * ```\n * it('...', async(inject([AClass], (object) => {\n * object.doSomething.then(() => {\n * expect(...);\n * })\n * });\n * ```\n *\n * @publicApi\n */\nexport function async(fn: Function): (done: any) => any {\n const _Zone: any = typeof Zone !== 'undefined' ? Zone : null;\n if (!_Zone) {\n return function() {\n return Promise.reject(\n 'Zone is needed for the async() test helper but could not be found. ' +\n 'Please make sure that your environment includes zone.js/dist/zone.js');\n };\n }\n const asyncTest = _Zone && _Zone[_Zone.__symbol__('asyncTest')];\n if (typeof asyncTest === 'function') {\n return asyncTest(fn);\n }\n // not using new version of zone.js\n // TODO @JiaLiPassion, remove this after all library updated to\n // newest version of zone.js(0.8.25)\n return asyncFallback(fn);\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef, ComponentRef, DebugElement, ElementRef, NgZone, RendererFactory2, getDebugNode} from '@angular/core';\n\n\n/**\n * Fixture for debugging and testing a component.\n *\n * @publicApi\n */\nexport class ComponentFixture<T> {\n /**\n * The DebugElement associated with the root element of this component.\n */\n debugElement: DebugElement;\n\n /**\n * The instance of the root component class.\n */\n componentInstance: T;\n\n /**\n * The native element at the root of the component.\n */\n nativeElement: any;\n\n /**\n * The ElementRef for the element at the root of the component.\n */\n elementRef: ElementRef;\n\n /**\n * The ChangeDetectorRef for the component\n */\n changeDetectorRef: ChangeDetectorRef;\n\n private _renderer: RendererFactory2|null|undefined;\n private _isStable: boolean = true;\n private _isDestroyed: boolean = false;\n private _resolve: ((result: any) => void)|null = null;\n private _promise: Promise<any>|null = null;\n private _onUnstableSubscription: any /** TODO #9100 */ = null;\n private _onStableSubscription: any /** TODO #9100 */ = null;\n private _onMicrotaskEmptySubscription: any /** TODO #9100 */ = null;\n private _onErrorSubscription: any /** TODO #9100 */ = null;\n\n constructor(\n public componentRef: ComponentRef<T>, public ngZone: NgZone|null,\n private _autoDetect: boolean) {\n this.changeDetectorRef = componentRef.changeDetectorRef;\n this.elementRef = componentRef.location;\n this.debugElement = <DebugElement>getDebugNode(this.elementRef.nativeElement);\n this.componentInstance = componentRef.instance;\n this.nativeElement = this.elementRef.nativeElement;\n this.componentRef = componentRef;\n this.ngZone = ngZone;\n\n if (ngZone) {\n // Create subscriptions outside the NgZone so that the callbacks run oustide\n // of NgZone.\n ngZone.runOutsideAngular(() => {\n this._onUnstableSubscription =\n ngZone.onUnstable.subscribe({next: () => { this._isStable = false; }});\n this._onMicrotaskEmptySubscription = ngZone.onMicrotaskEmpty.subscribe({\n next: () => {\n if (this._autoDetect) {\n // Do a change detection run with checkNoChanges set to true to check\n // there are no changes on the second run.\n this.detectChanges(true);\n }\n }\n });\n this._onStableSubscription = ngZone.onStable.subscribe({\n next: () => {\n this._isStable = true;\n // Check whether there is a pending whenStable() completer to resolve.\n if (this._promise !== null) {\n // If so check whether there are no pending macrotasks before resolving.\n // Do this check in the next tick so that ngZone gets a chance to update the state of\n // pending macrotasks.\n scheduleMicroTask(() => {\n if (!ngZone.hasPendingMacrotasks) {\n if (this._promise !== null) {\n this._resolve !(true);\n this._resolve = null;\n this._promise = null;\n }\n }\n });\n }\n }\n });\n\n this._onErrorSubscription =\n ngZone.onError.subscribe({next: (error: any) => { throw error; }});\n });\n }\n }\n\n private _tick(checkNoChanges: boolean) {\n this.changeDetectorRef.detectChanges();\n if (checkNoChanges) {\n this.checkNoChanges();\n }\n }\n\n /**\n * Trigger a change detection cycle for the component.\n */\n detectChanges(checkNoChanges: boolean = true): void {\n if (this.ngZone != null) {\n // Run the change detection inside the NgZone so that any async tasks as part of the change\n // detection are captured by the zone and can be waited for in isStable.\n this.ngZone.run(() => { this._tick(checkNoChanges); });\n } else {\n // Running without zone. Just do the change detection.\n this._tick(checkNoChanges);\n }\n }\n\n /**\n * Do a change detection run to make sure there were no changes.\n */\n checkNoChanges(): void { this.changeDetectorRef.checkNoChanges(); }\n\n /**\n * Set whether the fixture should autodetect changes.\n *\n * Also runs detectChanges once so that any existing change is detected.\n */\n autoDetectChanges(autoDetect: boolean = true) {\n if (this.ngZone == null) {\n throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set');\n }\n this._autoDetect = autoDetect;\n this.detectChanges();\n }\n\n /**\n * Return whether the fixture is currently stable or has async tasks that have not been completed\n * yet.\n */\n isStable(): boolean { return this._isStable && !this.ngZone !.hasPendingMacrotasks; }\n\n /**\n * Get a promise that resolves when the fixture is stable.\n *\n * This can be used to resume testing after events have triggered asynchronous activity or\n * asynchronous change detection.\n */\n whenStable(): Promise<any> {\n if (this.isStable()) {\n return Promise.resolve(false);\n } else if (this._promise !== null) {\n return this._promise;\n } else {\n this._promise = new Promise(res => { this._resolve = res; });\n return this._promise;\n }\n }\n\n\n private _getRenderer() {\n if (this._renderer === undefined) {\n this._renderer = this.componentRef.injector.get(RendererFactory2, null);\n }\n return this._renderer as RendererFactory2 | null;\n }\n\n /**\n * Get a promise that resolves when the ui state is stable following animations.\n */\n whenRenderingDone(): Promise<any> {\n const renderer = this._getRenderer();\n if (renderer && renderer.whenRenderingDone) {\n return renderer.whenRenderingDone();\n }\n return this.whenStable();\n }\n\n /**\n * Trigger component destruction.\n */\n destroy(): void {\n if (!this._isDestroyed) {\n this.componentRef.destroy();\n if (this._onUnstableSubscription != null) {\n this._onUnstableSubscription.unsubscribe();\n this._onUnstableSubscription = null;\n }\n if (this._onStableSubscription != null) {\n this._onStableSubscription.unsubscribe();\n this._onStableSubscription = null;\n }\n if (this._onMicrotaskEmptySubscription != null) {\n this._onMicrotaskEmptySubscription.unsubscribe();\n this._onMicrotaskEmptySubscription = null;\n }\n if (this._onErrorSubscription != null) {\n this._onErrorSubscription.unsubscribe();\n this._onErrorSubscription = null;\n }\n this._isDestroyed = true;\n }\n }\n}\n\nfunction scheduleMicroTask(fn: Function) {\n Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * fakeAsync has been moved to zone.js\n * this file is for fallback in case old version of zone.js is used\n */\nconst _Zone: any = typeof Zone !== 'undefined' ? Zone : null;\nconst FakeAsyncTestZoneSpec = _Zone && _Zone['FakeAsyncTestZoneSpec'];\ntype ProxyZoneSpec = {\n setDelegate(delegateSpec: ZoneSpec): void; getDelegate(): ZoneSpec; resetDelegate(): void;\n};\nconst ProxyZoneSpec: {get(): ProxyZoneSpec; assertPresent: () => ProxyZoneSpec} =\n _Zone && _Zone['ProxyZoneSpec'];\n\nlet _fakeAsyncTestZoneSpec: any = null;\n\n/**\n * Clears out the shared fake async zone for a test.\n * To be called in a global `beforeEach`.\n *\n * @publicApi\n */\nexport function resetFakeAsyncZoneFallback() {\n _fakeAsyncTestZoneSpec = null;\n // in node.js testing we may not have ProxyZoneSpec in which case there is nothing to reset.\n ProxyZoneSpec && ProxyZoneSpec.assertPresent().resetDelegate();\n}\n\nlet _inFakeAsyncCall = false;\n\n/**\n * Wraps a function to be executed in the fakeAsync zone:\n * - microtasks are manually executed by calling `flushMicrotasks()`,\n * - timers are synchronous, `tick()` simulates the asynchronous passage of time.\n *\n * If there are any pending timers at the end of the function, an exception will be thrown.\n *\n * Can be used to wrap inject() calls.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @param fn\n * @returns The function wrapped to be executed in the fakeAsync zone\n *\n * @publicApi\n */\nexport function fakeAsyncFallback(fn: Function): (...args: any[]) => any {\n // Not using an arrow function to preserve context passed from call site\n return function(...args: any[]) {\n const proxyZoneSpec = ProxyZoneSpec.assertPresent();\n if (_inFakeAsyncCall) {\n throw new Error('fakeAsync() calls can not be nested');\n }\n _inFakeAsyncCall = true;\n try {\n if (!_fakeAsyncTestZoneSpec) {\n if (proxyZoneSpec.getDelegate() instanceof FakeAsyncTestZoneSpec) {\n throw new Error('fakeAsync() calls can not be nested');\n }\n\n _fakeAsyncTestZoneSpec = new FakeAsyncTestZoneSpec();\n }\n\n let res: any;\n const lastProxyZoneSpec = proxyZoneSpec.getDelegate();\n proxyZoneSpec.setDelegate(_fakeAsyncTestZoneSpec);\n try {\n res = fn.apply(this, args);\n flushMicrotasksFallback();\n } finally {\n proxyZoneSpec.setDelegate(lastProxyZoneSpec);\n }\n\n if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {\n throw new Error(\n `${_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length} ` +\n `periodic timer(s) still in the queue.`);\n }\n\n if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {\n throw new Error(\n `${_fakeAsyncTestZoneSpec.pendingTimers.length} timer(s) still in the queue.`);\n }\n return res;\n } finally {\n _inFakeAsyncCall = false;\n resetFakeAsyncZoneFallback();\n }\n };\n}\n\nfunction _getFakeAsyncZoneSpec(): any {\n if (_fakeAsyncTestZoneSpec == null) {\n throw new Error('The code should be running in the fakeAsync zone to call this function');\n }\n return _fakeAsyncTestZoneSpec;\n}\n\n/**\n * Simulates the asynchronous passage of time for the timers in the fakeAsync zone.\n *\n * The microtasks queue is drained at the very start of this function and after any timer callback\n * has been executed.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @publicApi\n */\nexport function tickFallback(millis: number = 0): void {\n _getFakeAsyncZoneSpec().tick(millis);\n}\n\n/**\n * Simulates the asynchronous passage of time for the timers in the fakeAsync zone by\n * draining the macrotask queue until it is empty. The returned value is the milliseconds\n * of time that would have been elapsed.\n *\n * @param maxTurns\n * @returns The simulated time elapsed, in millis.\n *\n * @publicApi\n */\nexport function flushFallback(maxTurns?: number): number {\n return _getFakeAsyncZoneSpec().flush(maxTurns);\n}\n\n/**\n * Discard all remaining periodic tasks.\n *\n * @publicApi\n */\nexport function discardPeriodicTasksFallback(): void {\n const zoneSpec = _getFakeAsyncZoneSpec();\n zoneSpec.pendingPeriodicTimers.length = 0;\n}\n\n/**\n * Flush any pending microtasks.\n *\n * @publicApi\n */\nexport function flushMicrotasksFallback(): void {\n _getFakeAsyncZoneSpec().flushMicrotasks();\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {discardPeriodicTasksFallback, fakeAsyncFallback, flushFallback, flushMicrotasksFallback, resetFakeAsyncZoneFallback, tickFallback} from './fake_async_fallback';\n\nconst _Zone: any = typeof Zone !== 'undefined' ? Zone : null;\nconst fakeAsyncTestModule = _Zone && _Zone[_Zone.__symbol__('fakeAsyncTest')];\n\n/**\n * Clears out the shared fake async zone for a test.\n * To be called in a global `beforeEach`.\n *\n * @publicApi\n */\nexport function resetFakeAsyncZone(): void {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.resetFakeAsyncZone();\n } else {\n return resetFakeAsyncZoneFallback();\n }\n}\n\n/**\n * Wraps a function to be executed in the fakeAsync zone:\n * - microtasks are manually executed by calling `flushMicrotasks()`,\n * - timers are synchronous, `tick()` simulates the asynchronous passage of time.\n *\n * If there are any pending timers at the end of the function, an exception will be thrown.\n *\n * Can be used to wrap inject() calls.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @param fn\n * @returns The function wrapped to be executed in the fakeAsync zone\n *\n * @publicApi\n */\nexport function fakeAsync(fn: Function): (...args: any[]) => any {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.fakeAsync(fn);\n } else {\n return fakeAsyncFallback(fn);\n }\n}\n\n/**\n * Simulates the asynchronous passage of time for the timers in the fakeAsync zone.\n *\n * The microtasks queue is drained at the very start of this function and after any timer callback\n * has been executed.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @publicApi\n */\nexport function tick(millis: number = 0): void {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.tick(millis);\n } else {\n return tickFallback(millis);\n }\n}\n\n/**\n * Simulates the asynchronous passage of time for the timers in the fakeAsync zone by\n * draining the macrotask queue until it is empty. The returned value is the milliseconds\n * of time that would have been elapsed.\n *\n * @param maxTurns\n * @returns The simulated time elapsed, in millis.\n *\n * @publicApi\n */\nexport function flush(maxTurns?: number): number {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.flush(maxTurns);\n } else {\n return flushFallback(maxTurns);\n }\n}\n\n/**\n * Discard all remaining periodic tasks.\n *\n * @publicApi\n */\nexport function discardPeriodicTasks(): void {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.discardPeriodicTasks();\n } else {\n discardPeriodicTasksFallback();\n }\n}\n\n/**\n * Flush any pending microtasks.\n *\n * @publicApi\n */\nexport function flushMicrotasks(): void {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.flushMicrotasks();\n } else {\n return flushMicrotasksFallback();\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Injectable completer that allows signaling completion of an asynchronous test. Used internally.\n */\nexport class AsyncTestCompleter {\n // TODO(issue/24571): remove '!'.\n private _resolve !: (result: any) => void;\n // TODO(issue/24571): remove '!'.\n private _reject !: (err: any) => void;\n private _promise: Promise<any> = new Promise((res, rej) => {\n this._resolve = res;\n this._reject = rej;\n });\n done(value?: any) { this._resolve(value); }\n\n fail(error?: any, stackTrace?: string) { this._reject(error); }\n\n get promise(): Promise<any> { return this._promise; }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Component, Directive, InjectFlags, InjectionToken, NgModule, Pipe, PlatformRef, SchemaMetadata, Type} from '@angular/core';\n\nimport {ComponentFixture} from './component_fixture';\nimport {MetadataOverride} from './metadata_override';\nimport {TestBed} from './test_bed';\n\n/**\n * An abstract class for inserting the root test component element in a platform independent way.\n *\n * @publicApi\n */\nexport class TestComponentRenderer {\n insertRootElement(rootElementId: string) {}\n}\n\n/**\n * @publicApi\n */\nexport const ComponentFixtureAutoDetect =\n new InjectionToken<boolean[]>('ComponentFixtureAutoDetect');\n\n/**\n * @publicApi\n */\nexport const ComponentFixtureNoNgZone = new InjectionToken<boolean[]>('ComponentFixtureNoNgZone');\n\n/**\n * @publicApi\n */\nexport type TestModuleMetadata = {\n providers?: any[],\n declarations?: any[],\n imports?: any[],\n schemas?: Array<SchemaMetadata|any[]>,\n aotSummaries?: () => any[],\n};\n\n/**\n * Static methods implemented by the `TestBedViewEngine` and `TestBedRender3`\n *\n * @publicApi\n */\nexport interface TestBedStatic {\n new (...args: any[]): TestBed;\n\n initTestEnvironment(\n ngModule: Type<any>|Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed;\n\n /**\n * Reset the providers for the test injector.\n */\n resetTestEnvironment(): void;\n\n resetTestingModule(): TestBedStatic;\n\n /**\n * Allows overriding default compiler providers and settings\n * which are defined in test_injector.js\n */\n configureCompiler(config: {providers?: any[]; useJit?: boolean;}): TestBedStatic;\n\n /**\n * Allows overriding default providers, directives, pipes, modules of the test injector,\n * which are defined in test_injector.js\n */\n configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic;\n\n /**\n * Compile components with a `templateUrl` for the test's NgModule.\n * It is necessary to call this function\n * as fetching urls is asynchronous.\n */\n compileComponents(): Promise<any>;\n\n overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic;\n\n overrideComponent(component: Type<any>, override: MetadataOverride<Component>): TestBedStatic;\n\n overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): TestBedStatic;\n\n overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic;\n\n overrideTemplate(component: Type<any>, template: string): TestBedStatic;\n\n /**\n * Overrides the template of the given component, compiling the template\n * in the context of the TestingModule.\n *\n * Note: This works for JIT and AOTed components as well.\n */\n overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic;\n\n /**\n * Overwrites all providers for the given token with the given provider definition.\n *\n * Note: This works for JIT and AOTed components as well.\n */\n overrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): TestBedStatic;\n overrideProvider(token: any, provider: {useValue: any;}): TestBedStatic;\n overrideProvider(token: any, provider: {\n useFactory?: Function,\n useValue?: any,\n deps?: any[],\n }): TestBedStatic;\n\n get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;\n // TODO: switch back to official deprecation marker once TSLint issue is resolved\n // https://github.com/palantir/tslint/issues/4522\n /**\n * deprecated from v8.0.0 use Type<T> or InjectionToken<T>\n * This does not use the deprecated jsdoc tag on purpose\n * because it renders all overloads as deprecated in TSLint\n * due to https://github.com/palantir/tslint/issues/4522.\n */\n get(token: any, notFoundValue?: any): any;\n\n createComponent<T>(component: Type<T>): ComponentFixture<T>;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\nimport {Component} from './directives';\n\n\n/**\n * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n *\n * Example:\n * ```\n * @Component({\n * selector: 'my-comp',\n * templateUrl: 'my-comp.html', // This requires asynchronous resolution\n * })\n * class MyComponent{\n * }\n *\n * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process\n * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.\n *\n * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into\n * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.\n *\n * // Use browser's `fetch()` function as the default resource resolution strategy.\n * resolveComponentResources(fetch).then(() => {\n * // After resolution all URLs have been converted into `template` strings.\n * renderComponent(MyComponent);\n * });\n *\n * ```\n *\n * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n * to call this method outside JIT mode.\n *\n * @param resourceResolver a function which is responsible for returning a `Promise` to the\n * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.\n */\nexport function resolveComponentResources(\n resourceResolver: (url: string) => (Promise<string|{text(): Promise<string>}>)): Promise<void> {\n // Store all promises which are fetching the resources.\n const componentResolved: Promise<void>[] = [];\n\n // Cache so that we don't fetch the same resource more than once.\n const urlMap = new Map<string, Promise<string>>();\n function cachedResourceResolve(url: string): Promise<string> {\n let promise = urlMap.get(url);\n if (!promise) {\n const resp = resourceResolver(url);\n urlMap.set(url, promise = resp.then(unwrapResponse));\n }\n return promise;\n }\n\n componentResourceResolutionQueue.forEach((component: Component, type: Type<any>) => {\n const promises: Promise<void>[] = [];\n if (component.templateUrl) {\n promises.push(cachedResourceResolve(component.templateUrl).then((template) => {\n component.template = template;\n }));\n }\n const styleUrls = component.styleUrls;\n const styles = component.styles || (component.styles = []);\n const styleOffset = component.styles.length;\n styleUrls && styleUrls.forEach((styleUrl, index) => {\n styles.push(''); // pre-allocate array.\n promises.push(cachedResourceResolve(styleUrl).then((style) => {\n styles[styleOffset + index] = style;\n styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n if (styleUrls.length == 0) {\n component.styleUrls = undefined;\n }\n }));\n });\n const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));\n componentResolved.push(fullyResolved);\n });\n clearResolutionOfComponentResourcesQueue();\n return Promise.all(componentResolved).then(() => undefined);\n}\n\nlet componentResourceResolutionQueue = new Map<Type<any>, Component>();\n\n// Track when existing ngComponentDef for a Type is waiting on resources.\nconst componentDefPendingResolution = new Set<Type<any>>();\n\nexport function maybeQueueResolutionOfComponentResources(type: Type<any>, metadata: Component) {\n if (componentNeedsResolution(metadata)) {\n componentResourceResolutionQueue.set(type, metadata);\n componentDefPendingResolution.add(type);\n }\n}\n\nexport function isComponentDefPendingResolution(type: Type<any>): boolean {\n return componentDefPendingResolution.has(type);\n}\n\nexport function componentNeedsResolution(component: Component): boolean {\n return !!(\n (component.templateUrl && !component.hasOwnProperty('template')) ||\n component.styleUrls && component.styleUrls.length);\n}\nexport function clearResolutionOfComponentResourcesQueue(): Map<Type<any>, Component> {\n const old = componentResourceResolutionQueue;\n componentResourceResolutionQueue = new Map();\n return old;\n}\n\nexport function restoreComponentResolutionQueue(queue: Map<Type<any>, Component>): void {\n componentDefPendingResolution.clear();\n queue.forEach((_, type) => componentDefPendingResolution.add(type));\n componentResourceResolutionQueue = queue;\n}\n\nexport function isComponentResourceResolutionQueueEmpty() {\n return componentResourceResolutionQueue.size === 0;\n}\n\nfunction unwrapResponse(response: string | {text(): Promise<string>}): string|Promise<string> {\n return typeof response == 'string' ? response : response.text();\n}\n\nfunction componentDefResolved(type: Type<any>): void {\n componentDefPendingResolution.delete(type);\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵstringify as stringify} from '@angular/core';\nimport {MetadataOverride} from './metadata_override';\n\ntype StringMap = {\n [key: string]: any\n};\n\nlet _nextReferenceId = 0;\n\nexport class MetadataOverrider {\n private _references = new Map<any, string>();\n /**\n * Creates a new instance for the given metadata class\n * based on an old instance and overrides.\n */\n overrideMetadata<C extends T, T>(\n metadataClass: {new (options: T): C;}, oldMetadata: C, override: MetadataOverride<T>): C {\n const props: StringMap = {};\n if (oldMetadata) {\n _valueProps(oldMetadata).forEach((prop) => props[prop] = (<any>oldMetadata)[prop]);\n }\n\n if (override.set) {\n if (override.remove || override.add) {\n throw new Error(`Cannot set and add/remove ${stringify(metadataClass)} at the same time!`);\n }\n setMetadata(props, override.set);\n }\n if (override.remove) {\n removeMetadata(props, override.remove, this._references);\n }\n if (override.add) {\n addMetadata(props, override.add);\n }\n return new metadataClass(<any>props);\n }\n}\n\nfunction removeMetadata(metadata: StringMap, remove: any, references: Map<any, string>) {\n const removeObjects = new Set<string>();\n for (const prop in remove) {\n const removeValue = remove[prop];\n if (removeValue instanceof Array) {\n removeValue.forEach(\n (value: any) => { removeObjects.add(_propHashKey(prop, value, references)); });\n } else {\n removeObjects.add(_propHashKey(prop, removeValue, references));\n }\n }\n\n for (const prop in metadata) {\n const propValue = metadata[prop];\n if (propValue instanceof Array) {\n metadata[prop] = propValue.filter(\n (value: any) => !removeObjects.has(_propHashKey(prop, value, references)));\n } else {\n if (removeObjects.has(_propHashKey(prop, propValue, references))) {\n metadata[prop] = undefined;\n }\n }\n }\n}\n\nfunction addMetadata(metadata: StringMap, add: any) {\n for (const prop in add) {\n const addValue = add[prop];\n const propValue = metadata[prop];\n if (propValue != null && propValue instanceof Array) {\n metadata[prop] = propValue.concat(addValue);\n } else {\n metadata[prop] = addValue;\n }\n }\n}\n\nfunction setMetadata(metadata: StringMap, set: any) {\n for (const prop in set) {\n metadata[prop] = set[prop];\n }\n}\n\nfunction _propHashKey(propName: any, propValue: any, references: Map<any, string>): string {\n const replacer = (key: any, value: any) => {\n if (typeof value === 'function') {\n value = _serializeReference(value, references);\n }\n return value;\n };\n\n return `${propName}:${JSON.stringify(propValue, replacer)}`;\n}\n\nfunction _serializeReference(ref: any, references: Map<any, string>): string {\n let id = references.get(ref);\n if (!id) {\n id = `${stringify(ref)}${_nextReferenceId++}`;\n references.set(ref, id);\n }\n return id;\n}\n\n\nfunction _valueProps(obj: any): string[] {\n const props: string[] = [];\n // regular public props\n Object.keys(obj).forEach((prop) => {\n if (!prop.startsWith('_')) {\n props.push(prop);\n }\n });\n\n // getters\n let proto = obj;\n while (proto = Object.getPrototypeOf(proto)) {\n Object.keys(proto).forEach((protoProp) => {\n const desc = Object.getOwnPropertyDescriptor(proto, protoProp);\n if (!protoProp.startsWith('_') && desc && 'get' in desc) {\n props.push(protoProp);\n }\n });\n }\n return props;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Component, Directive, NgModule, Pipe, Type, ɵReflectionCapabilities as ReflectionCapabilities} from '@angular/core';\n\nimport {MetadataOverride} from './metadata_override';\nimport {MetadataOverrider} from './metadata_overrider';\n\nconst reflection = new ReflectionCapabilities();\n\n/**\n * Base interface to resolve `@Component`, `@Directive`, `@Pipe` and `@NgModule`.\n */\nexport interface Resolver<T> {\n addOverride(type: Type<any>, override: MetadataOverride<T>): void;\n setOverrides(overrides: Array<[Type<any>, MetadataOverride<T>]>): void;\n resolve(type: Type<any>): T|null;\n}\n\n/**\n * Allows to override ivy metadata for tests (via the `TestBed`).\n */\nabstract class OverrideResolver<T> implements Resolver<T> {\n private overrides = new Map<Type<any>, MetadataOverride<T>[]>();\n private resolved = new Map<Type<any>, T|null>();\n\n abstract get type(): any;\n\n addOverride(type: Type<any>, override: MetadataOverride<T>) {\n const overrides = this.overrides.get(type) || [];\n overrides.push(override);\n this.overrides.set(type, overrides);\n this.resolved.delete(type);\n }\n\n setOverrides(overrides: Array<[Type<any>, MetadataOverride<T>]>) {\n this.overrides.clear();\n overrides.forEach(([type, override]) => { this.addOverride(type, override); });\n }\n\n getAnnotation(type: Type<any>): T|null {\n const annotations = reflection.annotations(type);\n // Try to find the nearest known Type annotation and make sure that this annotation is an\n // instance of the type we are looking for, so we can use it for resolution. Note: there might\n // be multiple known annotations found due to the fact that Components can extend Directives (so\n // both Directive and Component annotations would be present), so we always check if the known\n // annotation has the right type.\n for (let i = annotations.length - 1; i >= 0; i--) {\n const annotation = annotations[i];\n const isKnownType = annotation instanceof Directive || annotation instanceof Component ||\n annotation instanceof Pipe || annotation instanceof NgModule;\n if (isKnownType) {\n return annotation instanceof this.type ? annotation : null;\n }\n }\n return null;\n }\n\n resolve(type: Type<any>): T|null {\n let resolved = this.resolved.get(type) || null;\n\n if (!resolved) {\n resolved = this.getAnnotation(type);\n if (resolved) {\n const overrides = this.overrides.get(type);\n if (overrides) {\n const overrider = new MetadataOverrider();\n overrides.forEach(override => {\n resolved = overrider.overrideMetadata(this.type, resolved !, override);\n });\n }\n }\n this.resolved.set(type, resolved);\n }\n\n return resolved;\n }\n}\n\n\nexport class DirectiveResolver extends OverrideResolver<Directive> {\n get type() { return Directive; }\n}\n\nexport class ComponentResolver extends OverrideResolver<Component> {\n get type() { return Component; }\n}\n\nexport class PipeResolver extends OverrideResolver<Pipe> {\n get type() { return Pipe; }\n}\n\nexport class NgModuleResolver extends OverrideResolver<NgModule> {\n get type() { return NgModule; }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ResourceLoader} from '@angular/compiler';\nimport {ApplicationInitStatus, COMPILER_OPTIONS, Compiler, Component, Directive, Injector, LOCALE_ID, ModuleWithComponentFactories, NgModule, NgModuleFactory, NgZone, Pipe, PlatformRef, Provider, Type, ɵDEFAULT_LOCALE_ID as DEFAULT_LOCALE_ID, ɵDirectiveDef as DirectiveDef, ɵNG_COMPONENT_DEF as NG_COMPONENT_DEF, ɵNG_DIRECTIVE_DEF as NG_DIRECTIVE_DEF, ɵNG_INJECTOR_DEF as NG_INJECTOR_DEF, ɵNG_MODULE_DEF as NG_MODULE_DEF, ɵNG_PIPE_DEF as NG_PIPE_DEF, ɵNgModuleFactory as R3NgModuleFactory, ɵNgModuleTransitiveScopes as NgModuleTransitiveScopes, ɵNgModuleType as NgModuleType, ɵRender3ComponentFactory as ComponentFactory, ɵRender3NgModuleRef as NgModuleRef, ɵcompileComponent as compileComponent, ɵcompileDirective as compileDirective, ɵcompileNgModuleDefs as compileNgModuleDefs, ɵcompilePipe as compilePipe, ɵgetInjectableDef as getInjectableDef, ɵpatchComponentDefWithScope as patchComponentDefWithScope, ɵsetLocaleId as setLocaleId, ɵtransitiveScopesFor as transitiveScopesFor, ɵɵInjectableDef as InjectableDef} from '@angular/core';\n\nimport {clearResolutionOfComponentResourcesQueue, isComponentDefPendingResolution, resolveComponentResources, restoreComponentResolutionQueue} from '../../src/metadata/resource_loading';\nimport {MetadataOverride} from './metadata_override';\nimport {ComponentResolver, DirectiveResolver, NgModuleResolver, PipeResolver, Resolver} from './resolvers';\nimport {TestModuleMetadata} from './test_bed_common';\n\nenum TestingModuleOverride {\n DECLARATION,\n OVERRIDE_TEMPLATE,\n}\n\nfunction isTestingModuleOverride(value: unknown): value is TestingModuleOverride {\n return value === TestingModuleOverride.DECLARATION ||\n value === TestingModuleOverride.OVERRIDE_TEMPLATE;\n}\n\n// Resolvers for Angular decorators\ntype Resolvers = {\n module: Resolver<NgModule>,\n component: Resolver<Directive>,\n directive: Resolver<Component>,\n pipe: Resolver<Pipe>,\n};\n\ninterface CleanupOperation {\n field: string;\n def: any;\n original: unknown;\n}\n\nexport class R3TestBedCompiler {\n private originalComponentResolutionQueue: Map<Type<any>, Component>|null = null;\n\n // Testing module configuration\n private declarations: Type<any>[] = [];\n private imports: Type<any>[] = [];\n private providers: Provider[] = [];\n private schemas: any[] = [];\n\n // Queues of components/directives/pipes that should be recompiled.\n private pendingComponents = new Set<Type<any>>();\n private pendingDirectives = new Set<Type<any>>();\n private pendingPipes = new Set<Type<any>>();\n\n // Keep track of all components and directives, so we can patch Providers onto defs later.\n private seenComponents = new Set<Type<any>>();\n private seenDirectives = new Set<Type<any>>();\n\n // Store resolved styles for Components that have template overrides present and `styleUrls`\n // defined at the same time.\n private existingComponentStyles = new Map<Type<any>, string[]>();\n\n private resolvers: Resolvers = initResolvers();\n\n private componentToModuleScope = new Map<Type<any>, Type<any>|TestingModuleOverride>();\n\n // Map that keeps initial version of component/directive/pipe defs in case\n // we compile a Type again, thus overriding respective static fields. This is\n // required to make sure we restore defs to their initial states between test runs\n // TODO: we should support the case with multiple defs on a type\n private initialNgDefs = new Map<Type<any>, [string, PropertyDescriptor|undefined]>();\n\n // Array that keeps cleanup operations for initial versions of component/directive/pipe/module\n // defs in case TestBed makes changes to the originals.\n private defCleanupOps: CleanupOperation[] = [];\n\n private _injector: Injector|null = null;\n private compilerProviders: Provider[]|null = null;\n\n private providerOverrides: Provider[] = [];\n private rootProviderOverrides: Provider[] = [];\n private providerOverridesByToken = new Map<any, Provider>();\n private moduleProvidersOverridden = new Set<Type<any>>();\n\n private testModuleType: NgModuleType<any>;\n private testModuleRef: NgModuleRef<any>|null = null;\n\n constructor(private platform: PlatformRef, private additionalModuleTypes: Type<any>|Type<any>[]) {\n class DynamicTestModule {}\n this.testModuleType = DynamicTestModule as any;\n }\n\n setCompilerProviders(providers: Provider[]|null): void {\n this.compilerProviders = providers;\n this._injector = null;\n }\n\n configureTestingModule(moduleDef: TestModuleMetadata): void {\n // Enqueue any compilation tasks for the directly declared component.\n if (moduleDef.declarations !== undefined) {\n this.queueTypeArray(moduleDef.declarations, TestingModuleOverride.DECLARATION);\n this.declarations.push(...moduleDef.declarations);\n }\n\n // Enqueue any compilation tasks for imported modules.\n if (moduleDef.imports !== undefined) {\n this.queueTypesFromModulesArray(moduleDef.imports);\n this.imports.push(...moduleDef.imports);\n }\n\n if (moduleDef.providers !== undefined) {\n this.providers.push(...moduleDef.providers);\n }\n\n if (moduleDef.schemas !== undefined) {\n this.schemas.push(...moduleDef.schemas);\n }\n }\n\n overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void {\n // Compile the module right away.\n this.resolvers.module.addOverride(ngModule, override);\n const metadata = this.resolvers.module.resolve(ngModule);\n if (metadata === null) {\n throw new Error(`${ngModule.name} is not an @NgModule or is missing metadata`);\n }\n\n this.recompileNgModule(ngModule);\n\n // At this point, the module has a valid .ngModuleDef, but the override may have introduced\n // new declarations or imported modules. Ingest any possible new types and add them to the\n // current queue.\n this.queueTypesFromModulesArray([ngModule]);\n }\n\n overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void {\n this.resolvers.component.addOverride(component, override);\n this.pendingComponents.add(component);\n }\n\n overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void {\n this.resolvers.directive.addOverride(directive, override);\n this.pendingDirectives.add(directive);\n }\n\n overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void {\n this.resolvers.pipe.addOverride(pipe, override);\n this.pendingPipes.add(pipe);\n }\n\n overrideProvider(\n token: any,\n provider: {useFactory?: Function, useValue?: any, deps?: any[], multi?: boolean}): void {\n const providerDef = provider.useFactory ?\n {\n provide: token,\n useFactory: provider.useFactory,\n deps: provider.deps || [],\n multi: provider.multi,\n } :\n {provide: token, useValue: provider.useValue, multi: provider.multi};\n\n let injectableDef: InjectableDef<any>|null;\n const isRoot =\n (typeof token !== 'string' && (injectableDef = getInjectableDef(token)) &&\n injectableDef.providedIn === 'root');\n const overridesBucket = isRoot ? this.rootProviderOverrides : this.providerOverrides;\n overridesBucket.push(providerDef);\n\n // Keep overrides grouped by token as well for fast lookups using token\n this.providerOverridesByToken.set(token, providerDef);\n }\n\n overrideTemplateUsingTestingModule(type: Type<any>, template: string): void {\n const def = (type as any)[NG_COMPONENT_DEF];\n const hasStyleUrls = (): boolean => {\n const metadata = this.resolvers.component.resolve(type) !as Component;\n return !!metadata.styleUrls && metadata.styleUrls.length > 0;\n };\n const overrideStyleUrls = !!def && !isComponentDefPendingResolution(type) && hasStyleUrls();\n\n // In Ivy, compiling a component does not require knowing the module providing the\n // component's scope, so overrideTemplateUsingTestingModule can be implemented purely via\n // overrideComponent. Important: overriding template requires full Component re-compilation,\n // which may fail in case styleUrls are also present (thus Component is considered as required\n // resolution). In order to avoid this, we preemptively set styleUrls to an empty array,\n // preserve current styles available on Component def and restore styles back once compilation\n // is complete.\n const override = overrideStyleUrls ? {template, styles: [], styleUrls: []} : {template};\n this.overrideComponent(type, {set: override});\n\n if (overrideStyleUrls && def.styles && def.styles.length > 0) {\n this.existingComponentStyles.set(type, def.styles);\n }\n\n // Set the component's scope to be the testing module.\n this.componentToModuleScope.set(type, TestingModuleOverride.OVERRIDE_TEMPLATE);\n }\n\n async compileComponents(): Promise<void> {\n this.clearComponentResolutionQueue();\n // Run compilers for all queued types.\n let needsAsyncResources = this.compileTypesSync();\n\n // compileComponents() should not be async unless it needs to be.\n if (needsAsyncResources) {\n let resourceLoader: ResourceLoader;\n let resolver = (url: string): Promise<string> => {\n if (!resourceLoader) {\n resourceLoader = this.injector.get(ResourceLoader);\n }\n return Promise.resolve(resourceLoader.get(url));\n };\n await resolveComponentResources(resolver);\n }\n }\n\n finalize(): NgModuleRef<any> {\n // One last compile\n this.compileTypesSync();\n\n // Create the testing module itself.\n this.compileTestModule();\n\n this.applyTransitiveScopes();\n\n this.applyProviderOverrides();\n\n // Patch previously stored `styles` Component values (taken from ngComponentDef), in case these\n // Components have `styleUrls` fields defined and template override was requested.\n this.patchComponentsWithExistingStyles();\n\n // Clear the componentToModuleScope map, so that future compilations don't reset the scope of\n // every component.\n this.componentToModuleScope.clear();\n\n const parentInjector = this.platform.injector;\n this.testModuleRef = new NgModuleRef(this.testModuleType, parentInjector);\n\n // Set the locale ID, it can be overridden for the tests\n const localeId = this.testModuleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);\n setLocaleId(localeId);\n\n // ApplicationInitStatus.runInitializers() is marked @internal to core.\n // Cast it to any before accessing it.\n (this.testModuleRef.injector.get(ApplicationInitStatus) as any).runInitializers();\n\n return this.testModuleRef;\n }\n\n /**\n * @internal\n */\n _compileNgModuleSync(moduleType: Type<any>): void {\n this.queueTypesFromModulesArray([moduleType]);\n this.compileTypesSync();\n this.applyProviderOverrides();\n this.applyProviderOverridesToModule(moduleType);\n this.applyTransitiveScopes();\n }\n\n /**\n * @internal\n */\n async _compileNgModuleAsync(moduleType: Type<any>): Promise<void> {\n this.queueTypesFromModulesArray([moduleType]);\n await this.compileComponents();\n this.applyProviderOverrides();\n this.applyProviderOverridesToModule(moduleType);\n this.applyTransitiveScopes();\n }\n\n /**\n * @internal\n */\n _getModuleResolver(): Resolver<NgModule> { return this.resolvers.module; }\n\n /**\n * @internal\n */\n _getComponentFactories(moduleType: NgModuleType): ComponentFactory<any>[] {\n return maybeUnwrapFn(moduleType.ngModuleDef.declarations).reduce((factories, declaration) => {\n const componentDef = (declaration as any).ngComponentDef;\n componentDef && factories.push(new ComponentFactory(componentDef, this.testModuleRef !));\n return factories;\n }, [] as ComponentFactory<any>[]);\n }\n\n private compileTypesSync(): boolean {\n // Compile all queued components, directives, pipes.\n let needsAsyncResources = false;\n this.pendingComponents.forEach(declaration => {\n needsAsyncResources = needsAsyncResources || isComponentDefPendingResolution(declaration);\n const metadata = this.resolvers.component.resolve(declaration) !;\n this.maybeStoreNgDef(NG_COMPONENT_DEF, declaration);\n compileComponent(declaration, metadata);\n });\n this.pendingComponents.clear();\n\n this.pendingDirectives.forEach(declaration => {\n const metadata = this.resolvers.directive.resolve(declaration) !;\n this.maybeStoreNgDef(NG_DIRECTIVE_DEF, declaration);\n compileDirective(declaration, metadata);\n });\n this.pendingDirectives.clear();\n\n this.pendingPipes.forEach(declaration => {\n const metadata = this.resolvers.pipe.resolve(declaration) !;\n this.maybeStoreNgDef(NG_PIPE_DEF, declaration);\n compilePipe(declaration, metadata);\n });\n this.pendingPipes.clear();\n\n return needsAsyncResources;\n }\n\n private applyTransitiveScopes(): void {\n const moduleToScope = new Map<Type<any>|TestingModuleOverride, NgModuleTransitiveScopes>();\n const getScopeOfModule =\n (moduleType: Type<any>| TestingModuleOverride): NgModuleTransitiveScopes => {\n if (!moduleToScope.has(moduleType)) {\n const realType = isTestingModuleOverride(moduleType) ? this.testModuleType : moduleType;\n moduleToScope.set(moduleType, transitiveScopesFor(realType));\n }\n return moduleToScope.get(moduleType) !;\n };\n\n this.componentToModuleScope.forEach((moduleType, componentType) => {\n const moduleScope = getScopeOfModule(moduleType);\n this.storeFieldOfDefOnType(componentType, NG_COMPONENT_DEF, 'directiveDefs');\n this.storeFieldOfDefOnType(componentType, NG_COMPONENT_DEF, 'pipeDefs');\n patchComponentDefWithScope((componentType as any).ngComponentDef, moduleScope);\n });\n\n this.componentToModuleScope.clear();\n }\n\n private applyProviderOverrides(): void {\n const maybeApplyOverrides = (field: string) => (type: Type<any>) => {\n const resolver =\n field === NG_COMPONENT_DEF ? this.resolvers.component : this.resolvers.directive;\n const metadata = resolver.resolve(type) !;\n if (this.hasProviderOverrides(metadata.providers)) {\n this.patchDefWithProviderOverrides(type, field);\n }\n };\n this.seenComponents.forEach(maybeApplyOverrides(NG_COMPONENT_DEF));\n this.seenDirectives.forEach(maybeApplyOverrides(NG_DIRECTIVE_DEF));\n\n this.seenComponents.clear();\n this.seenDirectives.clear();\n }\n\n private applyProviderOverridesToModule(moduleType: Type<any>): void {\n if (this.moduleProvidersOverridden.has(moduleType)) {\n return;\n }\n this.moduleProvidersOverridden.add(moduleType);\n\n const injectorDef: any = (moduleType as any)[NG_INJECTOR_DEF];\n if (this.providerOverridesByToken.size > 0) {\n if (this.hasProviderOverrides(injectorDef.providers)) {\n this.maybeStoreNgDef(NG_INJECTOR_DEF, moduleType);\n\n this.storeFieldOfDefOnType(moduleType, NG_INJECTOR_DEF, 'providers');\n injectorDef.providers = this.getOverriddenProviders(injectorDef.providers);\n }\n\n // Apply provider overrides to imported modules recursively\n const moduleDef: any = (moduleType as any)[NG_MODULE_DEF];\n for (const importType of moduleDef.imports) {\n this.applyProviderOverridesToModule(importType);\n }\n }\n }\n\n private patchComponentsWithExistingStyles(): void {\n this.existingComponentStyles.forEach(\n (styles, type) => (type as any)[NG_COMPONENT_DEF].styles = styles);\n this.existingComponentStyles.clear();\n }\n\n private queueTypeArray(arr: any[], moduleType: Type<any>|TestingModuleOverride): void {\n for (const value of arr) {\n if (Array.isArray(value)) {\n this.queueTypeArray(value, moduleType);\n } else {\n this.queueType(value, moduleType);\n }\n }\n }\n\n private recompileNgModule(ngModule: Type<any>): void {\n const metadata = this.resolvers.module.resolve(ngModule);\n if (metadata === null) {\n throw new Error(`Unable to resolve metadata for NgModule: ${ngModule.name}`);\n }\n // Cache the initial ngModuleDef as it will be overwritten.\n this.maybeStoreNgDef(NG_MODULE_DEF, ngModule);\n this.maybeStoreNgDef(NG_INJECTOR_DEF, ngModule);\n\n compileNgModuleDefs(ngModule as NgModuleType<any>, metadata);\n }\n\n private queueType(type: Type<any>, moduleType: Type<any>|TestingModuleOverride): void {\n const component = this.resolvers.component.resolve(type);\n if (component) {\n // Check whether a give Type has respective NG def (ngComponentDef) and compile if def is\n // missing. That might happen in case a class without any Angular decorators extends another\n // class where Component/Directive/Pipe decorator is defined.\n if (isComponentDefPendingResolution(type) || !type.hasOwnProperty(NG_COMPONENT_DEF)) {\n this.pendingComponents.add(type);\n }\n this.seenComponents.add(type);\n\n // Keep track of the module which declares this component, so later the component's scope\n // can be set correctly. If the component has already been recorded here, then one of several\n // cases is true:\n // * the module containing the component was imported multiple times (common).\n // * the component is declared in multiple modules (which is an error).\n // * the component was in 'declarations' of the testing module, and also in an imported module\n // in which case the module scope will be TestingModuleOverride.DECLARATION.\n // * overrideTemplateUsingTestingModule was called for the component in which case the module\n // scope will be TestingModuleOverride.OVERRIDE_TEMPLATE.\n //\n // If the component was previously in the testing module's 'declarations' (meaning the\n // current value is TestingModuleOverride.DECLARATION), then `moduleType` is the component's\n // real module, which was imported. This pattern is understood to mean that the component\n // should use its original scope, but that the testing module should also contain the\n // component in its scope.\n if (!this.componentToModuleScope.has(type) ||\n this.componentToModuleScope.get(type) === TestingModuleOverride.DECLARATION) {\n this.componentToModuleScope.set(type, moduleType);\n }\n return;\n }\n\n const directive = this.resolvers.directive.resolve(type);\n if (directive) {\n if (!type.hasOwnProperty(NG_DIRECTIVE_DEF)) {\n this.pendingDirectives.add(type);\n }\n this.seenDirectives.add(type);\n return;\n }\n\n const pipe = this.resolvers.pipe.resolve(type);\n if (pipe && !type.hasOwnProperty(NG_PIPE_DEF)) {\n this.pendingPipes.add(type);\n return;\n }\n }\n\n private queueTypesFromModulesArray(arr: any[]): void {\n for (const value of arr) {\n if (Array.isArray(value)) {\n this.queueTypesFromModulesArray(value);\n } else if (hasNgModuleDef(value)) {\n const def = value.ngModuleDef;\n // Look through declarations, imports, and exports, and queue everything found there.\n this.queueTypeArray(maybeUnwrapFn(def.declarations), value);\n this.queueTypesFromModulesArray(maybeUnwrapFn(def.imports));\n this.queueTypesFromModulesArray(maybeUnwrapFn(def.exports));\n }\n }\n }\n\n private maybeStoreNgDef(prop: string, type: Type<any>) {\n if (!this.initialNgDefs.has(type)) {\n const currentDef = Object.getOwnPropertyDescriptor(type, prop);\n this.initialNgDefs.set(type, [prop, currentDef]);\n }\n }\n\n private storeFieldOfDefOnType(type: Type<any>, defField: string, field: string): void {\n const def: any = (type as any)[defField];\n const original: any = def[field];\n this.defCleanupOps.push({field, def, original});\n }\n\n /**\n * Clears current components resolution queue, but stores the state of the queue, so we can\n * restore it later. Clearing the queue is required before we try to compile components (via\n * `TestBed.compileComponents`), so that component defs are in sync with the resolution queue.\n */\n private clearComponentResolutionQueue() {\n if (this.originalComponentResolutionQueue === null) {\n this.originalComponentResolutionQueue = new Map();\n }\n clearResolutionOfComponentResourcesQueue().forEach(\n (value, key) => this.originalComponentResolutionQueue !.set(key, value));\n }\n\n /*\n * Restores component resolution queue to the previously saved state. This operation is performed\n * as a part of restoring the state after completion of the current set of tests (that might\n * potentially mutate the state).\n */\n private restoreComponentResolutionQueue() {\n if (this.originalComponentResolutionQueue !== null) {\n restoreComponentResolutionQueue(this.originalComponentResolutionQueue);\n this.originalComponentResolutionQueue = null;\n }\n }\n\n restoreOriginalState(): void {\n for (const op of this.defCleanupOps) {\n op.def[op.field] = op.original;\n }\n // Restore initial component/directive/pipe defs\n this.initialNgDefs.forEach((value: [string, PropertyDescriptor], type: Type<any>) => {\n const [prop, descriptor] = value;\n if (!descriptor) {\n // Delete operations are generally undesirable since they have performance implications\n // on objects they were applied to. In this particular case, situations where this code is\n // invoked should be quite rare to cause any noticable impact, since it's applied only to\n // some test cases (for example when class with no annotations extends some @Component)\n // when we need to clear 'ngComponentDef' field on a given class to restore its original\n // state (before applying overrides and running tests).\n delete (type as any)[prop];\n } else {\n Object.defineProperty(type, prop, descriptor);\n }\n });\n this.initialNgDefs.clear();\n this.moduleProvidersOverridden.clear();\n this.restoreComponentResolutionQueue();\n // Restore the locale ID to the default value, this shouldn't be necessary but we never know\n setLocaleId(DEFAULT_LOCALE_ID);\n }\n\n private compileTestModule(): void {\n class RootScopeModule {}\n compileNgModuleDefs(RootScopeModule as NgModuleType<any>, {\n providers: [...this.rootProviderOverrides],\n });\n\n const ngZone = new NgZone({enableLongStackTrace: true});\n const providers: Provider[] = [\n {provide: NgZone, useValue: ngZone},\n {provide: Compiler, useFactory: () => new R3TestCompiler(this)},\n ...this.providers,\n ...this.providerOverrides,\n ];\n const imports = [RootScopeModule, this.additionalModuleTypes, this.imports || []];\n\n // clang-format off\n compileNgModuleDefs(this.testModuleType, {\n declarations: this.declarations,\n imports,\n schemas: this.schemas,\n providers,\n }, /* allowDuplicateDeclarationsInRoot */ true);\n // clang-format on\n\n this.applyProviderOverridesToModule(this.testModuleType);\n }\n\n get injector(): Injector {\n if (this._injector !== null) {\n return this._injector;\n }\n\n const providers: Provider[] = [];\n const compilerOptions = this.platform.injector.get(COMPILER_OPTIONS);\n compilerOptions.forEach(opts => {\n if (opts.providers) {\n providers.push(opts.providers);\n }\n });\n if (this.compilerProviders !== null) {\n providers.push(...this.compilerProviders);\n }\n\n // TODO(ocombe): make this work with an Injector directly instead of creating a module for it\n class CompilerModule {}\n compileNgModuleDefs(CompilerModule as NgModuleType<any>, {providers});\n\n const CompilerModuleFactory = new R3NgModuleFactory(CompilerModule);\n this._injector = CompilerModuleFactory.create(this.platform.injector).injector;\n return this._injector;\n }\n\n // get overrides for a specific provider (if any)\n private getSingleProviderOverrides(provider: Provider): Provider|null {\n const token = getProviderToken(provider);\n return this.providerOverridesByToken.get(token) || null;\n }\n\n private getProviderOverrides(providers?: Provider[]): Provider[] {\n if (!providers || !providers.length || this.providerOverridesByToken.size === 0) return [];\n // There are two flattening operations here. The inner flatten() operates on the metadata's\n // providers and applies a mapping function which retrieves overrides for each incoming\n // provider. The outer flatten() then flattens the produced overrides array. If this is not\n // done, the array can contain other empty arrays (e.g. `[[], []]`) which leak into the\n // providers array and contaminate any error messages that might be generated.\n return flatten(flatten(\n providers, (provider: Provider) => this.getSingleProviderOverrides(provider) || []));\n }\n\n private getOverriddenProviders(providers?: Provider[]): Provider[] {\n if (!providers || !providers.length || this.providerOverridesByToken.size === 0) return [];\n\n const overrides = this.getProviderOverrides(providers);\n const hasMultiProviderOverrides = overrides.some(isMultiProvider);\n const overriddenProviders = [...providers, ...overrides];\n\n // No additional processing is required in case we have no multi providers to override\n if (!hasMultiProviderOverrides) {\n return overriddenProviders;\n }\n\n const final: Provider[] = [];\n const seenMultiProviders = new Set<Provider>();\n\n // We iterate through the list of providers in reverse order to make sure multi provider\n // overrides take precedence over the values defined in provider list. We also fiter out all\n // multi providers that have overrides, keeping overridden values only.\n forEachRight(overriddenProviders, (provider: any) => {\n const token: any = getProviderToken(provider);\n if (isMultiProvider(provider) && this.providerOverridesByToken.has(token)) {\n if (!seenMultiProviders.has(token)) {\n seenMultiProviders.add(token);\n if (provider && provider.useValue && Array.isArray(provider.useValue)) {\n forEachRight(provider.useValue, (value: any) => {\n // Unwrap provider override array into individual providers in final set.\n final.unshift({provide: token, useValue: value, multi: true});\n });\n } else {\n final.unshift(provider);\n }\n }\n } else {\n final.unshift(provider);\n }\n });\n return final;\n }\n\n private hasProviderOverrides(providers?: Provider[]): boolean {\n return this.getProviderOverrides(providers).length > 0;\n }\n\n private patchDefWithProviderOverrides(declaration: Type<any>, field: string): void {\n const def = (declaration as any)[field];\n if (def && def.providersResolver) {\n this.maybeStoreNgDef(field, declaration);\n\n const resolver = def.providersResolver;\n const processProvidersFn = (providers: Provider[]) => this.getOverriddenProviders(providers);\n this.storeFieldOfDefOnType(declaration, field, 'providersResolver');\n def.providersResolver = (ngDef: DirectiveDef<any>) => resolver(ngDef, processProvidersFn);\n }\n }\n}\n\nfunction initResolvers(): Resolvers {\n return {\n module: new NgModuleResolver(),\n component: new ComponentResolver(),\n directive: new DirectiveResolver(),\n pipe: new PipeResolver()\n };\n}\n\nfunction hasNgModuleDef<T>(value: Type<T>): value is NgModuleType<T> {\n return value.hasOwnProperty('ngModuleDef');\n}\n\nfunction maybeUnwrapFn<T>(maybeFn: (() => T) | T): T {\n return maybeFn instanceof Function ? maybeFn() : maybeFn;\n}\n\nfunction flatten<T>(values: any[], mapFn?: (value: T) => any): T[] {\n const out: T[] = [];\n values.forEach(value => {\n if (Array.isArray(value)) {\n out.push(...flatten<T>(value, mapFn));\n } else {\n out.push(mapFn ? mapFn(value) : value);\n }\n });\n return out;\n}\n\nfunction getProviderField(provider: Provider, field: string) {\n return provider && typeof provider === 'object' && (provider as any)[field];\n}\n\nfunction getProviderToken(provider: Provider) {\n return getProviderField(provider, 'provide') || provider;\n}\n\nfunction isMultiProvider(provider: Provider) {\n return !!getProviderField(provider, 'multi');\n}\n\nfunction forEachRight<T>(values: T[], fn: (value: T, idx: number) => void): void {\n for (let idx = values.length - 1; idx >= 0; idx--) {\n fn(values[idx], idx);\n }\n}\n\nclass R3TestCompiler implements Compiler {\n constructor(private testBed: R3TestBedCompiler) {}\n\n compileModuleSync<T>(moduleType: Type<T>): NgModuleFactory<T> {\n this.testBed._compileNgModuleSync(moduleType);\n return new R3NgModuleFactory(moduleType);\n }\n\n async compileModuleAsync<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>> {\n await this.testBed._compileNgModuleAsync(moduleType);\n return new R3NgModuleFactory(moduleType);\n }\n\n compileModuleAndAllComponentsSync<T>(moduleType: Type<T>): ModuleWithComponentFactories<T> {\n const ngModuleFactory = this.compileModuleSync(moduleType);\n const componentFactories = this.testBed._getComponentFactories(moduleType as NgModuleType<T>);\n return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n }\n\n async compileModuleAndAllComponentsAsync<T>(moduleType: Type<T>):\n Promise<ModuleWithComponentFactories<T>> {\n const ngModuleFactory = await this.compileModuleAsync(moduleType);\n const componentFactories = this.testBed._getComponentFactories(moduleType as NgModuleType<T>);\n return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n }\n\n clearCache(): void {}\n\n clearCacheFor(type: Type<any>): void {}\n\n getModuleId(moduleType: Type<any>): string|undefined {\n const meta = this.testBed._getModuleResolver().resolve(moduleType);\n return meta && meta.id || undefined;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// The formatter and CI disagree on how this import statement should be formatted. Both try to keep\n// it on one line, too, which has gotten very hard to read & manage. So disable the formatter for\n// this statement only.\n// clang-format off\nimport {\n Component,\n Directive,\n InjectFlags,\n InjectionToken,\n Injector,\n NgModule,\n NgZone,\n Pipe,\n PlatformRef,\n Type,\n ɵRender3ComponentFactory as ComponentFactory,\n ɵRender3NgModuleRef as NgModuleRef,\n ɵflushModuleScopingQueueAsMuchAsPossible as flushModuleScopingQueueAsMuchAsPossible,\n ɵresetCompiledComponents as resetCompiledComponents,\n ɵstringify as stringify,\n} from '@angular/core';\n// clang-format on\n\nimport {ComponentFixture} from './component_fixture';\nimport {MetadataOverride} from './metadata_override';\nimport {TestBed} from './test_bed';\nimport {ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, TestBedStatic, TestComponentRenderer, TestModuleMetadata} from './test_bed_common';\nimport {R3TestBedCompiler} from './r3_test_bed_compiler';\n\nlet _nextRootElementId = 0;\n\nconst UNDEFINED: Symbol = Symbol('UNDEFINED');\n\n/**\n * @description\n * Configures and initializes environment for unit testing and provides methods for\n * creating components and services in unit tests.\n *\n * TestBed is the primary api for writing unit tests for Angular applications and libraries.\n *\n * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3`\n * according to the compiler used.\n */\nexport class TestBedRender3 implements Injector, TestBed {\n /**\n * Initialize the environment for testing with a compiler factory, a PlatformRef, and an\n * angular module. These are common to every test in the suite.\n *\n * This may only be called once, to set up the common providers for the current test\n * suite on the current platform. If you absolutely need to change the providers,\n * first use `resetTestEnvironment`.\n *\n * Test modules and platforms for individual platforms are available from\n * '@angular/<platform_name>/testing'.\n *\n * @publicApi\n */\n static initTestEnvironment(\n ngModule: Type<any>|Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed {\n const testBed = _getTestBedRender3();\n testBed.initTestEnvironment(ngModule, platform, aotSummaries);\n return testBed;\n }\n\n /**\n * Reset the providers for the test injector.\n *\n * @publicApi\n */\n static resetTestEnvironment(): void { _getTestBedRender3().resetTestEnvironment(); }\n\n static configureCompiler(config: {providers?: any[]; useJit?: boolean;}): TestBedStatic {\n _getTestBedRender3().configureCompiler(config);\n return TestBedRender3 as any as TestBedStatic;\n }\n\n /**\n * Allows overriding default providers, directives, pipes, modules of the test injector,\n * which are defined in test_injector.js\n */\n static configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic {\n _getTestBedRender3().configureTestingModule(moduleDef);\n return TestBedRender3 as any as TestBedStatic;\n }\n\n /**\n * Compile components with a `templateUrl` for the test's NgModule.\n * It is necessary to call this function\n * as fetching urls is asynchronous.\n */\n static compileComponents(): Promise<any> { return _getTestBedRender3().compileComponents(); }\n\n static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic {\n _getTestBedRender3().overrideModule(ngModule, override);\n return TestBedRender3 as any as TestBedStatic;\n }\n\n static overrideComponent(component: Type<any>, override: MetadataOverride<Component>):\n TestBedStatic {\n _getTestBedRender3().overrideComponent(component, override);\n return TestBedRender3 as any as TestBedStatic;\n }\n\n static overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>):\n TestBedStatic {\n _getTestBedRender3().overrideDirective(directive, override);\n return TestBedRender3 as any as TestBedStatic;\n }\n\n static overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic {\n _getTestBedRender3().overridePipe(pipe, override);\n return TestBedRender3 as any as TestBedStatic;\n }\n\n static overrideTemplate(component: Type<any>, template: string): TestBedStatic {\n _getTestBedRender3().overrideComponent(component, {set: {template, templateUrl: null !}});\n return TestBedRender3 as any as TestBedStatic;\n }\n\n /**\n * Overrides the template of the given component, compiling the template\n * in the context of the TestingModule.\n *\n * Note: This works for JIT and AOTed components as well.\n */\n static overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic {\n _getTestBedRender3().overrideTemplateUsingTestingModule(component, template);\n return TestBedRender3 as any as TestBedStatic;\n }\n\n static overrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): TestBedStatic;\n static overrideProvider(token: any, provider: {useValue: any;}): TestBedStatic;\n static overrideProvider(token: any, provider: {\n useFactory?: Function,\n useValue?: any,\n deps?: any[],\n }): TestBedStatic {\n _getTestBedRender3().overrideProvider(token, provider);\n return TestBedRender3 as any as TestBedStatic;\n }\n\n static get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;\n /**\n * @deprecated from v8.0.0 use Type<T> or InjectionToken<T>\n */\n static get(token: any, notFoundValue?: any): any;\n static get(\n token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n flags: InjectFlags = InjectFlags.Default): any {\n return _getTestBedRender3().get(token, notFoundValue);\n }\n\n static createComponent<T>(component: Type<T>): ComponentFixture<T> {\n return _getTestBedRender3().createComponent(component);\n }\n\n static resetTestingModule(): TestBedStatic {\n _getTestBedRender3().resetTestingModule();\n return TestBedRender3 as any as TestBedStatic;\n }\n\n // Properties\n\n platform: PlatformRef = null !;\n ngModule: Type<any>|Type<any>[] = null !;\n\n private _compiler: R3TestBedCompiler|null = null;\n private _testModuleRef: NgModuleRef<any>|null = null;\n\n private _activeFixtures: ComponentFixture<any>[] = [];\n private _globalCompilationChecked = false;\n\n /**\n * Initialize the environment for testing with a compiler factory, a PlatformRef, and an\n * angular module. These are common to every test in the suite.\n *\n * This may only be called once, to set up the common providers for the current test\n * suite on the current platform. If you absolutely need to change the providers,\n * first use `resetTestEnvironment`.\n *\n * Test modules and platforms for individual platforms are available from\n * '@angular/<platform_name>/testing'.\n *\n * @publicApi\n */\n initTestEnvironment(\n ngModule: Type<any>|Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void {\n if (this.platform || this.ngModule) {\n throw new Error('Cannot set base providers because it has already been called');\n }\n this.platform = platform;\n this.ngModule = ngModule;\n this._compiler = new R3TestBedCompiler(this.platform, this.ngModule);\n }\n\n /**\n * Reset the providers for the test injector.\n *\n * @publicApi\n */\n resetTestEnvironment(): void {\n this.resetTestingModule();\n this._compiler = null;\n this.platform = null !;\n this.ngModule = null !;\n }\n\n resetTestingModule(): void {\n this.checkGlobalCompilationFinished();\n resetCompiledComponents();\n if (this._compiler !== null) {\n this.compiler.restoreOriginalState();\n }\n this._compiler = new R3TestBedCompiler(this.platform, this.ngModule);\n this._testModuleRef = null;\n this.destroyActiveFixtures();\n }\n\n configureCompiler(config: {providers?: any[]; useJit?: boolean;}): void {\n if (config.useJit != null) {\n throw new Error('the Render3 compiler JiT mode is not configurable !');\n }\n\n if (config.providers !== undefined) {\n this.compiler.setCompilerProviders(config.providers);\n }\n }\n\n configureTestingModule(moduleDef: TestModuleMetadata): void {\n this.assertNotInstantiated('R3TestBed.configureTestingModule', 'configure the test module');\n this.compiler.configureTestingModule(moduleDef);\n }\n\n compileComponents(): Promise<any> { return this.compiler.compileComponents(); }\n\n get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;\n /**\n * @deprecated from v8.0.0 use Type<T> or InjectionToken<T>\n */\n get(token: any, notFoundValue?: any): any;\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n flags: InjectFlags = InjectFlags.Default): any {\n if (token === TestBedRender3) {\n return this;\n }\n const result = this.testModuleRef.injector.get(token, UNDEFINED, flags);\n return result === UNDEFINED ? this.compiler.injector.get(token, notFoundValue, flags) : result;\n }\n\n execute(tokens: any[], fn: Function, context?: any): any {\n const params = tokens.map(t => this.get(t));\n return fn.apply(context, params);\n }\n\n overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void {\n this.assertNotInstantiated('overrideModule', 'override module metadata');\n this.compiler.overrideModule(ngModule, override);\n }\n\n overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void {\n this.assertNotInstantiated('overrideComponent', 'override component metadata');\n this.compiler.overrideComponent(component, override);\n }\n\n overrideTemplateUsingTestingModule(component: Type<any>, template: string): void {\n this.assertNotInstantiated(\n 'R3TestBed.overrideTemplateUsingTestingModule',\n 'Cannot override template when the test module has already been instantiated');\n this.compiler.overrideTemplateUsingTestingModule(component, template);\n }\n\n overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void {\n this.assertNotInstantiated('overrideDirective', 'override directive metadata');\n this.compiler.overrideDirective(directive, override);\n }\n\n overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void {\n this.assertNotInstantiated('overridePipe', 'override pipe metadata');\n this.compiler.overridePipe(pipe, override);\n }\n\n /**\n * Overwrites all providers for the given token with the given provider definition.\n */\n overrideProvider(token: any, provider: {useFactory?: Function, useValue?: any, deps?: any[]}):\n void {\n this.compiler.overrideProvider(token, provider);\n }\n\n createComponent<T>(type: Type<T>): ComponentFixture<T> {\n const testComponentRenderer: TestComponentRenderer = this.get(TestComponentRenderer);\n const rootElId = `root-ng-internal-isolated-${_nextRootElementId++}`;\n testComponentRenderer.insertRootElement(rootElId);\n\n const componentDef = (type as any).ngComponentDef;\n\n if (!componentDef) {\n throw new Error(\n `It looks like '${stringify(type)}' has not been IVY compiled - it has no 'ngComponentDef' field`);\n }\n\n // TODO: Don't cast as `any`, proper type is boolean[]\n const noNgZone = this.get(ComponentFixtureNoNgZone as any, false);\n // TODO: Don't cast as `any`, proper type is boolean[]\n const autoDetect: boolean = this.get(ComponentFixtureAutoDetect as any, false);\n const ngZone: NgZone|null = noNgZone ? null : this.get(NgZone as Type<NgZone|null>, null);\n const componentFactory = new ComponentFactory(componentDef);\n const initComponent = () => {\n const componentRef =\n componentFactory.create(Injector.NULL, [], `#${rootElId}`, this.testModuleRef);\n return new ComponentFixture<any>(componentRef, ngZone, autoDetect);\n };\n const fixture = ngZone ? ngZone.run(initComponent) : initComponent();\n this._activeFixtures.push(fixture);\n return fixture;\n }\n\n private get compiler(): R3TestBedCompiler {\n if (this._compiler === null) {\n throw new Error(`Need to call TestBed.initTestEnvironment() first`);\n }\n return this._compiler;\n }\n\n private get testModuleRef(): NgModuleRef<any> {\n if (this._testModuleRef === null) {\n this._testModuleRef = this.compiler.finalize();\n }\n return this._testModuleRef;\n }\n\n private assertNotInstantiated(methodName: string, methodDescription: string) {\n if (this._testModuleRef !== null) {\n throw new Error(\n `Cannot ${methodDescription} when the test module has already been instantiated. ` +\n `Make sure you are not using \\`inject\\` before \\`${methodName}\\`.`);\n }\n }\n\n /**\n * Check whether the module scoping queue should be flushed, and flush it if needed.\n *\n * When the TestBed is reset, it clears the JIT module compilation queue, cancelling any\n * in-progress module compilation. This creates a potential hazard - the very first time the\n * TestBed is initialized (or if it's reset without being initialized), there may be pending\n * compilations of modules declared in global scope. These compilations should be finished.\n *\n * To ensure that globally declared modules have their components scoped properly, this function\n * is called whenever TestBed is initialized or reset. The _first_ time that this happens, prior\n * to any other operations, the scoping queue is flushed.\n */\n private checkGlobalCompilationFinished(): void {\n // Checking _testNgModuleRef is null should not be necessary, but is left in as an additional\n // guard that compilations queued in tests (after instantiation) are never flushed accidentally.\n if (!this._globalCompilationChecked && this._testModuleRef === null) {\n flushModuleScopingQueueAsMuchAsPossible();\n }\n this._globalCompilationChecked = true;\n }\n\n private destroyActiveFixtures(): void {\n this._activeFixtures.forEach((fixture) => {\n try {\n fixture.destroy();\n } catch (e) {\n console.error('Error during cleanup of component', {\n component: fixture.componentInstance,\n stacktrace: e,\n });\n }\n });\n this._activeFixtures = [];\n }\n}\n\nlet testBed: TestBedRender3;\n\nexport function _getTestBedRender3(): TestBedRender3 {\n return testBed = testBed || new TestBedRender3();\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Compiler, CompilerOptions, Component, ComponentFactory, Directive, Injectable, Injector, NgModule, Pipe, Type} from '@angular/core';\n\nimport {MetadataOverride} from './metadata_override';\n\nfunction unimplemented(): any {\n throw Error('unimplemented');\n}\n\n/**\n * Special interface to the compiler only used by testing\n *\n * @publicApi\n */\n@Injectable()\nexport class TestingCompiler extends Compiler {\n get injector(): Injector { throw unimplemented(); }\n overrideModule(module: Type<any>, overrides: MetadataOverride<NgModule>): void {\n throw unimplemented();\n }\n overrideDirective(directive: Type<any>, overrides: MetadataOverride<Directive>): void {\n throw unimplemented();\n }\n overrideComponent(component: Type<any>, overrides: MetadataOverride<Component>): void {\n throw unimplemented();\n }\n overridePipe(directive: Type<any>, overrides: MetadataOverride<Pipe>): void {\n throw unimplemented();\n }\n /**\n * Allows to pass the compile summary from AOT compilation to the JIT compiler,\n * so that it can use the code generated by AOT.\n */\n loadAotSummaries(summaries: () => any[]) { throw unimplemented(); }\n\n /**\n * Gets the component factory for the given component.\n * This assumes that the component has been compiled before calling this call using\n * `compileModuleAndAllComponents*`.\n */\n getComponentFactory<T>(component: Type<T>): ComponentFactory<T> { throw unimplemented(); }\n\n /**\n * Returns the component type that is stored in the given error.\n * This can be used for errors created by compileModule...\n */\n getComponentFromError(error: Error): Type<any>|null { throw unimplemented(); }\n}\n\n/**\n * A factory for creating a Compiler\n *\n * @publicApi\n */\nexport abstract class TestingCompilerFactory {\n abstract createTestingCompiler(options?: CompilerOptions[]): TestingCompiler;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationInitStatus, CompilerOptions, Component, Directive, InjectFlags, InjectionToken, Injector, NgModule, NgModuleFactory, NgModuleRef, NgZone, Optional, Pipe, PlatformRef, Provider, SchemaMetadata, SkipSelf, StaticProvider, Type, ɵAPP_ROOT as APP_ROOT, ɵDepFlags as DepFlags, ɵNodeFlags as NodeFlags, ɵclearOverrides as clearOverrides, ɵgetInjectableDef as getInjectableDef, ɵivyEnabled as ivyEnabled, ɵoverrideComponentView as overrideComponentView, ɵoverrideProvider as overrideProvider, ɵstringify as stringify, ɵɵInjectableDef} from '@angular/core';\n\nimport {AsyncTestCompleter} from './async_test_completer';\nimport {ComponentFixture} from './component_fixture';\nimport {MetadataOverride} from './metadata_override';\nimport {TestBedRender3, _getTestBedRender3} from './r3_test_bed';\nimport {ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, TestBedStatic, TestComponentRenderer, TestModuleMetadata} from './test_bed_common';\nimport {TestingCompiler, TestingCompilerFactory} from './test_compiler';\n\n\nconst UNDEFINED = new Object();\n\n\nlet _nextRootElementId = 0;\n\n/**\n * @publicApi\n */\nexport interface TestBed {\n platform: PlatformRef;\n\n ngModule: Type<any>|Type<any>[];\n\n /**\n * Initialize the environment for testing with a compiler factory, a PlatformRef, and an\n * angular module. These are common to every test in the suite.\n *\n * This may only be called once, to set up the common providers for the current test\n * suite on the current platform. If you absolutely need to change the providers,\n * first use `resetTestEnvironment`.\n *\n * Test modules and platforms for individual platforms are available from\n * '@angular/<platform_name>/testing'.\n */\n initTestEnvironment(\n ngModule: Type<any>|Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;\n\n /**\n * Reset the providers for the test injector.\n */\n resetTestEnvironment(): void;\n\n resetTestingModule(): void;\n\n configureCompiler(config: {providers?: any[], useJit?: boolean}): void;\n\n configureTestingModule(moduleDef: TestModuleMetadata): void;\n\n compileComponents(): Promise<any>;\n\n get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;\n\n // TODO: switch back to official deprecation marker once TSLint issue is resolved\n // https://github.com/palantir/tslint/issues/4522\n /**\n * deprecated from v8.0.0 use Type<T> or InjectionToken<T>\n * This does not use the deprecated jsdoc tag on purpose\n * because it renders all overloads as deprecated in TSLint\n * due to https://github.com/palantir/tslint/issues/4522.\n */\n get(token: any, notFoundValue?: any): any;\n\n execute(tokens: any[], fn: Function, context?: any): any;\n\n overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void;\n\n overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;\n\n overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;\n\n overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void;\n\n /**\n * Overwrites all providers for the given token with the given provider definition.\n */\n overrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): void;\n overrideProvider(token: any, provider: {useValue: any;}): void;\n overrideProvider(token: any, provider: {useFactory?: Function, useValue?: any, deps?: any[]}):\n void;\n\n overrideTemplateUsingTestingModule(component: Type<any>, template: string): void;\n\n createComponent<T>(component: Type<T>): ComponentFixture<T>;\n}\n\n/**\n * @description\n * Configures and initializes environment for unit testing and provides methods for\n * creating components and services in unit tests.\n *\n * `TestBed` is the primary api for writing unit tests for Angular applications and libraries.\n *\n * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3`\n * according to the compiler used.\n */\nexport class TestBedViewEngine implements Injector, TestBed {\n /**\n * Initialize the environment for testing with a compiler factory, a PlatformRef, and an\n * angular module. These are common to every test in the suite.\n *\n * This may only be called once, to set up the common providers for the current test\n * suite on the current platform. If you absolutely need to change the providers,\n * first use `resetTestEnvironment`.\n *\n * Test modules and platforms for individual platforms are available from\n * '@angular/<platform_name>/testing'.\n */\n static initTestEnvironment(\n ngModule: Type<any>|Type<any>[], platform: PlatformRef,\n aotSummaries?: () => any[]): TestBedViewEngine {\n const testBed = _getTestBedViewEngine();\n testBed.initTestEnvironment(ngModule, platform, aotSummaries);\n return testBed;\n }\n\n /**\n * Reset the providers for the test injector.\n */\n static resetTestEnvironment(): void { _getTestBedViewEngine().resetTestEnvironment(); }\n\n static resetTestingModule(): TestBedStatic {\n _getTestBedViewEngine().resetTestingModule();\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n /**\n * Allows overriding default compiler providers and settings\n * which are defined in test_injector.js\n */\n static configureCompiler(config: {providers?: any[]; useJit?: boolean;}): TestBedStatic {\n _getTestBedViewEngine().configureCompiler(config);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n /**\n * Allows overriding default providers, directives, pipes, modules of the test injector,\n * which are defined in test_injector.js\n */\n static configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic {\n _getTestBedViewEngine().configureTestingModule(moduleDef);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n /**\n * Compile components with a `templateUrl` for the test's NgModule.\n * It is necessary to call this function\n * as fetching urls is asynchronous.\n */\n static compileComponents(): Promise<any> { return getTestBed().compileComponents(); }\n\n static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic {\n _getTestBedViewEngine().overrideModule(ngModule, override);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n static overrideComponent(component: Type<any>, override: MetadataOverride<Component>):\n TestBedStatic {\n _getTestBedViewEngine().overrideComponent(component, override);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n static overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>):\n TestBedStatic {\n _getTestBedViewEngine().overrideDirective(directive, override);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n static overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic {\n _getTestBedViewEngine().overridePipe(pipe, override);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n static overrideTemplate(component: Type<any>, template: string): TestBedStatic {\n _getTestBedViewEngine().overrideComponent(component, {set: {template, templateUrl: null !}});\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n /**\n * Overrides the template of the given component, compiling the template\n * in the context of the TestingModule.\n *\n * Note: This works for JIT and AOTed components as well.\n */\n static overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic {\n _getTestBedViewEngine().overrideTemplateUsingTestingModule(component, template);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n /**\n * Overwrites all providers for the given token with the given provider definition.\n *\n * Note: This works for JIT and AOTed components as well.\n */\n static overrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): TestBedStatic;\n static overrideProvider(token: any, provider: {useValue: any;}): TestBedStatic;\n static overrideProvider(token: any, provider: {\n useFactory?: Function,\n useValue?: any,\n deps?: any[],\n }): TestBedStatic {\n _getTestBedViewEngine().overrideProvider(token, provider as any);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n static get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;\n /**\n * @deprecated from v8.0.0 use Type<T> or InjectionToken<T>\n * @suppress {duplicate}\n */\n static get(token: any, notFoundValue?: any): any;\n static get(\n token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n flags: InjectFlags = InjectFlags.Default): any {\n return _getTestBedViewEngine().get(token, notFoundValue, flags);\n }\n\n static createComponent<T>(component: Type<T>): ComponentFixture<T> {\n return _getTestBedViewEngine().createComponent(component);\n }\n\n private _instantiated: boolean = false;\n\n private _compiler: TestingCompiler = null !;\n private _moduleRef: NgModuleRef<any> = null !;\n private _moduleFactory: NgModuleFactory<any> = null !;\n\n private _compilerOptions: CompilerOptions[] = [];\n\n private _moduleOverrides: [Type<any>, MetadataOverride<NgModule>][] = [];\n private _componentOverrides: [Type<any>, MetadataOverride<Component>][] = [];\n private _directiveOverrides: [Type<any>, MetadataOverride<Directive>][] = [];\n private _pipeOverrides: [Type<any>, MetadataOverride<Pipe>][] = [];\n\n private _providers: Provider[] = [];\n private _declarations: Array<Type<any>|any[]|any> = [];\n private _imports: Array<Type<any>|any[]|any> = [];\n private _schemas: Array<SchemaMetadata|any[]> = [];\n private _activeFixtures: ComponentFixture<any>[] = [];\n\n private _testEnvAotSummaries: () => any[] = () => [];\n private _aotSummaries: Array<() => any[]> = [];\n private _templateOverrides: Array<{component: Type<any>, templateOf: Type<any>}> = [];\n\n private _isRoot: boolean = true;\n private _rootProviderOverrides: Provider[] = [];\n\n platform: PlatformRef = null !;\n\n ngModule: Type<any>|Type<any>[] = null !;\n\n /**\n * Initialize the environment for testing with a compiler factory, a PlatformRef, and an\n * angular module. These are common to every test in the suite.\n *\n * This may only be called once, to set up the common providers for the current test\n * suite on the current platform. If you absolutely need to change the providers,\n * first use `resetTestEnvironment`.\n *\n * Test modules and platforms for individual platforms are available from\n * '@angular/<platform_name>/testing'.\n */\n initTestEnvironment(\n ngModule: Type<any>|Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void {\n if (this.platform || this.ngModule) {\n throw new Error('Cannot set base providers because it has already been called');\n }\n this.platform = platform;\n this.ngModule = ngModule;\n if (aotSummaries) {\n this._testEnvAotSummaries = aotSummaries;\n }\n }\n\n /**\n * Reset the providers for the test injector.\n */\n resetTestEnvironment(): void {\n this.resetTestingModule();\n this.platform = null !;\n this.ngModule = null !;\n this._testEnvAotSummaries = () => [];\n }\n\n resetTestingModule(): void {\n clearOverrides();\n this._aotSummaries = [];\n this._templateOverrides = [];\n this._compiler = null !;\n this._moduleOverrides = [];\n this._componentOverrides = [];\n this._directiveOverrides = [];\n this._pipeOverrides = [];\n\n this._isRoot = true;\n this._rootProviderOverrides = [];\n\n this._moduleRef = null !;\n this._moduleFactory = null !;\n this._compilerOptions = [];\n this._providers = [];\n this._declarations = [];\n this._imports = [];\n this._schemas = [];\n this._instantiated = false;\n this._activeFixtures.forEach((fixture) => {\n try {\n fixture.destroy();\n } catch (e) {\n console.error('Error during cleanup of component', {\n component: fixture.componentInstance,\n stacktrace: e,\n });\n }\n });\n this._activeFixtures = [];\n }\n\n configureCompiler(config: {providers?: any[], useJit?: boolean}): void {\n this._assertNotInstantiated('TestBed.configureCompiler', 'configure the compiler');\n this._compilerOptions.push(config);\n }\n\n configureTestingModule(moduleDef: TestModuleMetadata): void {\n this._assertNotInstantiated('TestBed.configureTestingModule', 'configure the test module');\n if (moduleDef.providers) {\n this._providers.push(...moduleDef.providers);\n }\n if (moduleDef.declarations) {\n this._declarations.push(...moduleDef.declarations);\n }\n if (moduleDef.imports) {\n this._imports.push(...moduleDef.imports);\n }\n if (moduleDef.schemas) {\n this._schemas.push(...moduleDef.schemas);\n }\n if (moduleDef.aotSummaries) {\n this._aotSummaries.push(moduleDef.aotSummaries);\n }\n }\n\n compileComponents(): Promise<any> {\n if (this._moduleFactory || this._instantiated) {\n return Promise.resolve(null);\n }\n\n const moduleType = this._createCompilerAndModule();\n return this._compiler.compileModuleAndAllComponentsAsync(moduleType)\n .then((moduleAndComponentFactories) => {\n this._moduleFactory = moduleAndComponentFactories.ngModuleFactory;\n });\n }\n\n private _initIfNeeded(): void {\n if (this._instantiated) {\n return;\n }\n if (!this._moduleFactory) {\n try {\n const moduleType = this._createCompilerAndModule();\n this._moduleFactory =\n this._compiler.compileModuleAndAllComponentsSync(moduleType).ngModuleFactory;\n } catch (e) {\n const errorCompType = this._compiler.getComponentFromError(e);\n if (errorCompType) {\n throw new Error(\n `This test module uses the component ${stringify(errorCompType)} which is using a \"templateUrl\" or \"styleUrls\", but they were never compiled. ` +\n `Please call \"TestBed.compileComponents\" before your test.`);\n } else {\n throw e;\n }\n }\n }\n for (const {component, templateOf} of this._templateOverrides) {\n const compFactory = this._compiler.getComponentFactory(templateOf);\n overrideComponentView(component, compFactory);\n }\n\n const ngZone = new NgZone({enableLongStackTrace: true});\n const providers: StaticProvider[] = [{provide: NgZone, useValue: ngZone}];\n const ngZoneInjector = Injector.create({\n providers: providers,\n parent: this.platform.injector,\n name: this._moduleFactory.moduleType.name\n });\n this._moduleRef = this._moduleFactory.create(ngZoneInjector);\n // ApplicationInitStatus.runInitializers() is marked @internal to core. So casting to any\n // before accessing it.\n (this._moduleRef.injector.get(ApplicationInitStatus) as any).runInitializers();\n this._instantiated = true;\n }\n\n private _createCompilerAndModule(): Type<any> {\n const providers = this._providers.concat([{provide: TestBed, useValue: this}]);\n const declarations =\n [...this._declarations, ...this._templateOverrides.map(entry => entry.templateOf)];\n\n const rootScopeImports = [];\n const rootProviderOverrides = this._rootProviderOverrides;\n if (this._isRoot) {\n @NgModule({\n providers: [\n ...rootProviderOverrides,\n ],\n jit: true,\n })\n class RootScopeModule {\n }\n rootScopeImports.push(RootScopeModule);\n }\n providers.push({provide: APP_ROOT, useValue: this._isRoot});\n\n const imports = [rootScopeImports, this.ngModule, this._imports];\n const schemas = this._schemas;\n\n @NgModule({providers, declarations, imports, schemas, jit: true})\n class DynamicTestModule {\n }\n\n const compilerFactory: TestingCompilerFactory =\n this.platform.injector.get(TestingCompilerFactory);\n this._compiler = compilerFactory.createTestingCompiler(this._compilerOptions);\n for (const summary of [this._testEnvAotSummaries, ...this._aotSummaries]) {\n this._compiler.loadAotSummaries(summary);\n }\n this._moduleOverrides.forEach((entry) => this._compiler.overrideModule(entry[0], entry[1]));\n this._componentOverrides.forEach(\n (entry) => this._compiler.overrideComponent(entry[0], entry[1]));\n this._directiveOverrides.forEach(\n (entry) => this._compiler.overrideDirective(entry[0], entry[1]));\n this._pipeOverrides.forEach((entry) => this._compiler.overridePipe(entry[0], entry[1]));\n return DynamicTestModule;\n }\n\n private _assertNotInstantiated(methodName: string, methodDescription: string) {\n if (this._instantiated) {\n throw new Error(\n `Cannot ${methodDescription} when the test module has already been instantiated. ` +\n `Make sure you are not using \\`inject\\` before \\`${methodName}\\`.`);\n }\n }\n\n get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;\n /**\n * @deprecated from v8.0.0 use Type<T> or InjectionToken<T>\n */\n get(token: any, notFoundValue?: any): any;\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n flags: InjectFlags = InjectFlags.Default): any {\n this._initIfNeeded();\n if (token === TestBed) {\n return this;\n }\n // Tests can inject things from the ng module and from the compiler,\n // but the ng module can't inject things from the compiler and vice versa.\n const result = this._moduleRef.injector.get(token, UNDEFINED, flags);\n return result === UNDEFINED ? this._compiler.injector.get(token, notFoundValue, flags) : result;\n }\n\n execute(tokens: any[], fn: Function, context?: any): any {\n this._initIfNeeded();\n const params = tokens.map(t => this.get(t));\n return fn.apply(context, params);\n }\n\n overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void {\n this._assertNotInstantiated('overrideModule', 'override module metadata');\n this._moduleOverrides.push([ngModule, override]);\n }\n\n overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void {\n this._assertNotInstantiated('overrideComponent', 'override component metadata');\n this._componentOverrides.push([component, override]);\n }\n\n overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void {\n this._assertNotInstantiated('overrideDirective', 'override directive metadata');\n this._directiveOverrides.push([directive, override]);\n }\n\n overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void {\n this._assertNotInstantiated('overridePipe', 'override pipe metadata');\n this._pipeOverrides.push([pipe, override]);\n }\n\n /**\n * Overwrites all providers for the given token with the given provider definition.\n */\n overrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): void;\n overrideProvider(token: any, provider: {useValue: any;}): void;\n overrideProvider(token: any, provider: {useFactory?: Function, useValue?: any, deps?: any[]}):\n void {\n this.overrideProviderImpl(token, provider);\n }\n\n private overrideProviderImpl(\n token: any, provider: {\n useFactory?: Function,\n useValue?: any,\n deps?: any[],\n },\n deprecated = false): void {\n let def: ɵɵInjectableDef<any>|null = null;\n if (typeof token !== 'string' && (def = getInjectableDef(token)) && def.providedIn === 'root') {\n if (provider.useFactory) {\n this._rootProviderOverrides.push(\n {provide: token, useFactory: provider.useFactory, deps: provider.deps || []});\n } else {\n this._rootProviderOverrides.push({provide: token, useValue: provider.useValue});\n }\n }\n let flags: NodeFlags = 0;\n let value: any;\n if (provider.useFactory) {\n flags |= NodeFlags.TypeFactoryProvider;\n value = provider.useFactory;\n } else {\n flags |= NodeFlags.TypeValueProvider;\n value = provider.useValue;\n }\n const deps = (provider.deps || []).map((dep) => {\n let depFlags: DepFlags = DepFlags.None;\n let depToken: any;\n if (Array.isArray(dep)) {\n dep.forEach((entry: any) => {\n if (entry instanceof Optional) {\n depFlags |= DepFlags.Optional;\n } else if (entry instanceof SkipSelf) {\n depFlags |= DepFlags.SkipSelf;\n } else {\n depToken = entry;\n }\n });\n } else {\n depToken = dep;\n }\n return [depFlags, depToken];\n });\n overrideProvider({token, flags, deps, value, deprecatedBehavior: deprecated});\n }\n\n overrideTemplateUsingTestingModule(component: Type<any>, template: string) {\n this._assertNotInstantiated('overrideTemplateUsingTestingModule', 'override template');\n\n @Component({selector: 'empty', template, jit: true})\n class OverrideComponent {\n }\n\n this._templateOverrides.push({component, templateOf: OverrideComponent});\n }\n\n createComponent<T>(component: Type<T>): ComponentFixture<T> {\n this._initIfNeeded();\n const componentFactory = this._compiler.getComponentFactory(component);\n\n if (!componentFactory) {\n throw new Error(\n `Cannot create the component ${stringify(component)} as it was not imported into the testing module!`);\n }\n\n // TODO: Don't cast as `any`, proper type is boolean[]\n const noNgZone = this.get(ComponentFixtureNoNgZone as any, false);\n // TODO: Don't cast as `any`, proper type is boolean[]\n const autoDetect: boolean = this.get(ComponentFixtureAutoDetect as any, false);\n const ngZone: NgZone|null = noNgZone ? null : this.get(NgZone as Type<NgZone|null>, null);\n const testComponentRenderer: TestComponentRenderer = this.get(TestComponentRenderer);\n const rootElId = `root${_nextRootElementId++}`;\n testComponentRenderer.insertRootElement(rootElId);\n\n const initComponent = () => {\n const componentRef =\n componentFactory.create(Injector.NULL, [], `#${rootElId}`, this._moduleRef);\n return new ComponentFixture<T>(componentRef, ngZone, autoDetect);\n };\n\n const fixture = !ngZone ? initComponent() : ngZone.run(initComponent);\n this._activeFixtures.push(fixture);\n return fixture;\n }\n}\n\n/**\n * @description\n * Configures and initializes environment for unit testing and provides methods for\n * creating components and services in unit tests.\n *\n * `TestBed` is the primary api for writing unit tests for Angular applications and libraries.\n *\n * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3`\n * according to the compiler used.\n *\n * @publicApi\n */\nexport const TestBed: TestBedStatic =\n ivyEnabled ? TestBedRender3 as any as TestBedStatic : TestBedViewEngine as any as TestBedStatic;\n\n/**\n * Returns a singleton of the applicable `TestBed`.\n *\n * It will be either an instance of `TestBedViewEngine` or `TestBedRender3`.\n *\n * @publicApi\n */\nexport const getTestBed: () => TestBed = ivyEnabled ? _getTestBedRender3 : _getTestBedViewEngine;\n\nlet testBed: TestBedViewEngine;\n\nfunction _getTestBedViewEngine(): TestBedViewEngine {\n return testBed = testBed || new TestBedViewEngine();\n}\n\n/**\n * Allows injecting dependencies in `beforeEach()` and `it()`.\n *\n * Example:\n *\n * ```\n * beforeEach(inject([Dependency, AClass], (dep, object) => {\n * // some code that uses `dep` and `object`\n * // ...\n * }));\n *\n * it('...', inject([AClass], (object) => {\n * object.doSomething();\n * expect(...);\n * })\n * ```\n *\n * Notes:\n * - inject is currently a function because of some Traceur limitation the syntax should\n * eventually\n * becomes `it('...', @Inject (object: AClass, async: AsyncTestCompleter) => { ... });`\n *\n * @publicApi\n */\nexport function inject(tokens: any[], fn: Function): () => any {\n const testBed = getTestBed();\n if (tokens.indexOf(AsyncTestCompleter) >= 0) {\n // Not using an arrow function to preserve context passed from call site\n return function() {\n // Return an async test method that returns a Promise if AsyncTestCompleter is one of\n // the injected tokens.\n return testBed.compileComponents().then(() => {\n const completer: AsyncTestCompleter = testBed.get(AsyncTestCompleter);\n testBed.execute(tokens, fn, this);\n return completer.promise;\n });\n };\n } else {\n // Not using an arrow function to preserve context passed from call site\n return function() { return testBed.execute(tokens, fn, this); };\n }\n}\n\n/**\n * @publicApi\n */\nexport class InjectSetupWrapper {\n constructor(private _moduleDef: () => TestModuleMetadata) {}\n\n private _addModule() {\n const moduleDef = this._moduleDef();\n if (moduleDef) {\n getTestBed().configureTestingModule(moduleDef);\n }\n }\n\n inject(tokens: any[], fn: Function): () => any {\n const self = this;\n // Not using an arrow function to preserve context passed from call site\n return function() {\n self._addModule();\n return inject(tokens, fn).call(this);\n };\n }\n}\n\n/**\n * @publicApi\n */\nexport function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;\nexport function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;\nexport function withModule(moduleDef: TestModuleMetadata, fn?: Function | null): (() => any)|\n InjectSetupWrapper {\n if (fn) {\n // Not using an arrow function to preserve context passed from call site\n return function() {\n const testBed = getTestBed();\n if (moduleDef) {\n testBed.configureTestingModule(moduleDef);\n }\n return fn.apply(this);\n };\n }\n return new InjectSetupWrapper(() => moduleDef);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Public Test Library for unit testing Angular applications. Assumes that you are running\n * with Jasmine, Mocha, or a similar framework which exports a beforeEach function and\n * allows tests to be asynchronous by either returning a promise or using a 'done' parameter.\n */\n\nimport {resetFakeAsyncZone} from './fake_async';\nimport {TestBed} from './test_bed';\n\ndeclare var global: any;\n\nconst _global = <any>(typeof window === 'undefined' ? global : window);\n\n// Reset the test providers and the fake async zone before each test.\nif (_global.beforeEach) {\n _global.beforeEach(() => {\n TestBed.resetTestingModule();\n resetFakeAsyncZone();\n });\n}\n\n// TODO(juliemr): remove this, only used because we need to export something to have compilation\n// work.\nexport const __core_private_testing_placeholder__ = '';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {TestingCompiler as ɵTestingCompiler, TestingCompilerFactory as ɵTestingCompilerFactory} from './test_compiler';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the core/testing package.\n */\n\nexport * from './async';\nexport * from './component_fixture';\nexport * from './fake_async';\nexport {TestBed, getTestBed, inject, InjectSetupWrapper, withModule} from './test_bed';\nexport * from './test_bed_common';\nexport * from './before_each';\nexport * from './metadata_override';\nexport {MetadataOverrider as ɵMetadataOverrider} from './metadata_overrider';\nexport * from './private_export_testing';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"jasmine\" />\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {TestBedRender3 as ɵangular_packages_core_testing_testing_b,_getTestBedRender3 as ɵangular_packages_core_testing_testing_c} from './src/r3_test_bed';\nexport {TestBedViewEngine as ɵangular_packages_core_testing_testing_a} from './src/test_bed';"],"names":["_Zone","stringify","ReflectionCapabilities","tslib_1.__extends","getInjectableDef","NG_COMPONENT_DEF","NgModuleRef","DEFAULT_LOCALE_ID","setLocaleId","ComponentFactory","compileComponent","NG_DIRECTIVE_DEF","compileDirective","NG_PIPE_DEF","compilePipe","transitiveScopesFor","patchComponentDefWithScope","NG_INJECTOR_DEF","NG_MODULE_DEF","tslib_1.__values","compileNgModuleDefs","R3NgModuleFactory","resetCompiledComponents","flushModuleScopingQueueAsMuchAsPossible","UNDEFINED","_nextRootElementId","clearOverrides","overrideComponentView","APP_ROOT","overrideProvider","ivyEnabled","testBed","_global"],"mappings":";;;;;;;;;;AAAA;;;;;;;AAcA,IAAM,OAAO,IAAS,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;;;;;;;;;;;;;;;;;;AAmBvE,SAAgB,aAAa,CAAC,EAAY;;;IAGxC,IAAI,OAAO,CAAC,OAAO,EAAE;;QAEnB,OAAO,UAAS,IAAS;YACvB,IAAI,CAAC,IAAI,EAAE;;;gBAGT,IAAI,GAAG,eAAa,CAAC;gBACrB,IAAI,CAAC,IAAI,GAAG,UAAS,CAAM,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC;aAC3C;YACD,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAC,GAAQ;gBACrC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;oBAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAS,GAAG,CAAC,CAAC,CAAC;iBAC1C;qBAAM;oBACL,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBAChB;aACF,CAAC,CAAC;SACJ,CAAC;KACH;;;;;IAKD,OAAO;QAAA,iBAIN;QAHC,OAAO,IAAI,OAAO,CAAO,UAAC,cAAc,EAAE,YAAY;YACpD,aAAa,CAAC,EAAE,EAAE,KAAI,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;SACvD,CAAC,CAAC;KACJ,CAAC;CACH;AAED,SAAS,aAAa,CAClB,EAAY,EAAE,OAAY,EAAE,cAAwB,EAAE,YAAsB;IAC9E,IAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC;IACjC,IAAM,iBAAiB,GAAI,IAAY,CAAC,mBAAmB,CAAC,CAAC;IAC7D,IAAI,iBAAiB,KAAK,SAAS,EAAE;QACnC,MAAM,IAAI,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