1 | {"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/metadata_overrider.ts","../../../../../../packages/core/testing/src/resolvers.ts","../../../../../../packages/core/testing/src/test_bed_common.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 * @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 {ɵ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> { resolve(type: Type<any>): T|null; }\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 setOverrides(overrides: Array<[Type<any>, MetadataOverride<T>]>) {\n this.overrides.clear();\n overrides.forEach(([type, override]) => {\n const overrides = this.overrides.get(type) || [];\n overrides.push(override);\n this.overrides.set(type, overrides);\n });\n }\n\n getAnnotation(type: Type<any>): T|null {\n return reflection.annotations(type).find(a => a instanceof this.type) || 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 {Component, Directive, 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 /**\n * Overwrites all providers for the given token with the given provider definition.\n *\n * @deprecated as it makes all NgModules lazy. Introduced only for migrating off of it.\n */\n deprecatedOverrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): void;\n deprecatedOverrideProvider(token: any, provider: {useValue: any;}): void;\n deprecatedOverrideProvider(token: any, provider: {\n useFactory?: Function,\n useValue?: any,\n deps?: any[],\n }): TestBedStatic;\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 {ApplicationInitStatus, Component, Directive, Injector, NgModule, NgZone, Pipe, PlatformRef, Provider, SchemaMetadata, Type, resolveForwardRef, ɵInjectableDef as InjectableDef, ɵNgModuleDef as NgModuleDef, ɵ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, ɵresetCompiledComponents as resetCompiledComponents, ɵstringify as stringify} from '@angular/core';\n\nimport {ComponentFixture} from './component_fixture';\nimport {MetadataOverride} from './metadata_override';\nimport {ComponentResolver, DirectiveResolver, NgModuleResolver, PipeResolver, Resolver} from './resolvers';\nimport {TestBed} from './test_bed';\nimport {ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, TestBedStatic, TestComponentRenderer, TestModuleMetadata} from './test_bed_common';\n\nlet _nextRootElementId = 0;\n\nconst EMPTY_ARRAY: Type<any>[] = [];\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\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 overrideTemplateUsingTestingModule(component: Type<any>, template: string): void {\n if (this._instantiated) {\n throw new Error(\n 'Cannot override template when the test module has already been instantiated');\n }\n this._templateOverrides.set(component, template);\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 /**\n * Overwrites all providers for the given token with the given provider definition.\n *\n * @deprecated as it makes all NgModules lazy. Introduced only for migrating off of it.\n */\n static deprecatedOverrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): void;\n static deprecatedOverrideProvider(token: any, provider: {useValue: any;}): void;\n static deprecatedOverrideProvider(token: any, provider: {\n useFactory?: Function,\n useValue?: any,\n deps?: any[],\n }): TestBedStatic {\n throw new Error('Render3TestBed.deprecatedOverrideProvider is not implemented');\n }\n\n static get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): 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 // metadata overrides\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 private _providerOverrides: Provider[] = [];\n private _rootProviderOverrides: Provider[] = [];\n private _providerOverridesByToken: Map<any, Provider[]> = new Map();\n private _templateOverrides: Map<Type<any>, string> = new Map();\n\n // test module configuration\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\n private _activeFixtures: ComponentFixture<any>[] = [];\n\n private _moduleRef: NgModuleRef<any> = null !;\n private _testModuleType: NgModuleType<any> = null !;\n\n private _instantiated: boolean = 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 }\n\n /**\n * Reset the providers for the test injector.\n *\n * @publicApi\n */\n resetTestEnvironment(): void {\n this.resetTestingModule();\n this.platform = null !;\n this.ngModule = null !;\n }\n\n resetTestingModule(): void {\n resetCompiledComponents();\n // reset metadata overrides\n this._moduleOverrides = [];\n this._componentOverrides = [];\n this._directiveOverrides = [];\n this._pipeOverrides = [];\n this._providerOverrides = [];\n this._rootProviderOverrides = [];\n this._providerOverridesByToken.clear();\n this._templateOverrides.clear();\n\n // reset test module config\n this._providers = [];\n this._declarations = [];\n this._imports = [];\n this._schemas = [];\n this._moduleRef = null !;\n this._testModuleType = null !;\n\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 if (config.useJit != null) {\n throw new Error('the Render3 compiler JiT mode is not configurable !');\n }\n\n if (config.providers) {\n this._providerOverrides.push(...config.providers);\n }\n }\n\n configureTestingModule(moduleDef: TestModuleMetadata): void {\n this._assertNotInstantiated('R3TestBed.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 }\n\n compileComponents(): Promise<any> {\n // assume for now that components don't use templateUrl / stylesUrl to unblock further testing\n // TODO(pk): plug into the ivy's resource fetching pipeline\n return Promise.resolve();\n }\n\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n this._initIfNeeded();\n if (token === TestBedRender3) {\n return this;\n }\n return this._moduleRef.injector.get(token, notFoundValue);\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: {useFactory?: Function, useValue?: any, deps?: any[]}):\n void {\n const providerDef = provider.useFactory ?\n {provide: token, useFactory: provider.useFactory, deps: provider.deps || []} :\n {provide: token, useValue: provider.useValue};\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 all overrides grouped by token as well for fast lookups using token\n const overridesForToken = this._providerOverridesByToken.get(token) || [];\n overridesForToken.push(providerDef);\n this._providerOverridesByToken.set(token, overridesForToken);\n }\n\n /**\n * Overwrites all providers for the given token with the given provider definition.\n *\n * @deprecated as it makes all NgModules lazy. Introduced only for migrating off of it.\n */\n deprecatedOverrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): void;\n deprecatedOverrideProvider(token: any, provider: {useValue: any;}): void;\n deprecatedOverrideProvider(\n token: any, provider: {useFactory?: Function, useValue?: any, deps?: any[]}): void {\n throw new Error('No implemented in IVY');\n }\n\n createComponent<T>(type: Type<T>): ComponentFixture<T> {\n this._initIfNeeded();\n\n const testComponentRenderer: TestComponentRenderer = this.get(TestComponentRenderer);\n const rootElId = `root${_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 const noNgZone: boolean = this.get(ComponentFixtureNoNgZone, false);\n const autoDetect: boolean = this.get(ComponentFixtureAutoDetect, false);\n const ngZone: NgZone = noNgZone ? null : this.get(NgZone, null);\n const componentFactory = new ComponentFactory(componentDef);\n const initComponent = () => {\n const componentRef =\n componentFactory.create(Injector.NULL, [], `#${rootElId}`, this._moduleRef);\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 // internal methods\n\n private _initIfNeeded(): void {\n if (this._instantiated) {\n return;\n }\n\n const resolvers = this._getResolvers();\n this._testModuleType = this._createTestModule();\n this._compileNgModule(this._testModuleType, resolvers);\n\n const parentInjector = this.platform.injector;\n this._moduleRef = new NgModuleRef(this._testModuleType, parentInjector);\n\n // ApplicationInitStatus.runInitializers() is marked @internal\n // to core. Cast it to any before accessing it.\n (this._moduleRef.injector.get(ApplicationInitStatus) as any).runInitializers();\n this._instantiated = true;\n }\n\n // get overrides for a specific provider (if any)\n private _getProviderOverrides(provider: any) {\n const token = typeof provider === 'object' && provider.hasOwnProperty('provide') ?\n provider.provide :\n provider;\n return this._providerOverridesByToken.get(token) || [];\n }\n\n // creates resolvers taking overrides into account\n private _getResolvers() {\n const module = new NgModuleResolver();\n module.setOverrides(this._moduleOverrides);\n\n const component = new ComponentResolver();\n component.setOverrides(this._componentOverrides);\n\n const directive = new DirectiveResolver();\n directive.setOverrides(this._directiveOverrides);\n\n const pipe = new PipeResolver();\n pipe.setOverrides(this._pipeOverrides);\n\n return {module, component, directive, pipe};\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 private _createTestModule(): NgModuleType {\n const rootProviderOverrides = this._rootProviderOverrides;\n\n @NgModule({\n providers: [...rootProviderOverrides],\n jit: true,\n })\n class RootScopeModule {\n }\n\n const ngZone = new NgZone({enableLongStackTrace: true});\n const providers =\n [{provide: NgZone, useValue: ngZone}, ...this._providers, ...this._providerOverrides];\n\n const declarations = this._declarations;\n const imports = [RootScopeModule, this.ngModule, this._imports];\n const schemas = this._schemas;\n\n @NgModule({providers, declarations, imports, schemas, jit: true})\n class DynamicTestModule {\n }\n\n return DynamicTestModule as NgModuleType;\n }\n\n private _getMetaWithOverrides(meta: Component|Directive|NgModule, type?: Type<any>) {\n const overrides: {providers?: any[], template?: string} = {};\n if (meta.providers && meta.providers.length) {\n const providerOverrides =\n flatten(meta.providers, (provider: any) => this._getProviderOverrides(provider));\n if (providerOverrides.length) {\n overrides.providers = [...meta.providers, ...providerOverrides];\n }\n }\n const hasTemplateOverride = !!type && this._templateOverrides.has(type);\n if (hasTemplateOverride) {\n overrides.template = this._templateOverrides.get(type !);\n }\n return Object.keys(overrides).length ? {...meta, ...overrides} : meta;\n }\n\n private _compileNgModule(moduleType: NgModuleType, resolvers: Resolvers): void {\n const ngModule = resolvers.module.resolve(moduleType);\n\n if (ngModule === null) {\n throw new Error(`${stringify(moduleType)} has not @NgModule annotation`);\n }\n\n const metadata = this._getMetaWithOverrides(ngModule);\n compileNgModuleDefs(moduleType, metadata);\n\n const declarations: Type<any>[] =\n flatten(ngModule.declarations || EMPTY_ARRAY, resolveForwardRef);\n const compiledComponents: Type<any>[] = [];\n\n // Compile the components, directives and pipes declared by this module\n declarations.forEach(declaration => {\n const component = resolvers.component.resolve(declaration);\n if (component) {\n const metadata = this._getMetaWithOverrides(component, declaration);\n compileComponent(declaration, metadata);\n compiledComponents.push(declaration);\n return;\n }\n\n const directive = resolvers.directive.resolve(declaration);\n if (directive) {\n const metadata = this._getMetaWithOverrides(directive);\n compileDirective(declaration, metadata);\n return;\n }\n\n const pipe = resolvers.pipe.resolve(declaration);\n if (pipe) {\n compilePipe(declaration, pipe);\n return;\n }\n });\n\n // Compile transitive modules, components, directives and pipes\n const transitiveScope = this._transitiveScopesFor(moduleType, resolvers);\n compiledComponents.forEach(cmp => {\n const scope = this._templateOverrides.has(cmp) ?\n // if we have template override via `TestBed.overrideTemplateUsingTestingModule` -\n // define Component scope as TestingModule scope, instead of the scope of NgModule\n // where this Component was declared\n this._transitiveScopesFor(this._testModuleType, resolvers) :\n transitiveScope;\n patchComponentDefWithScope((cmp as any).ngComponentDef, scope);\n });\n }\n\n /**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given\n * module.\n *\n * This operation is memoized and the result is cached on the module's definition. It can be\n * called on modules with components that have not fully compiled yet, but the result should not\n * be used until they have.\n */\n private _transitiveScopesFor<T>(moduleType: Type<T>, resolvers: Resolvers):\n NgModuleTransitiveScopes {\n if (!isNgModule(moduleType)) {\n throw new Error(`${moduleType.name} does not have an ngModuleDef`);\n }\n const def = moduleType.ngModuleDef;\n\n if (def.transitiveCompileScopes !== null) {\n return def.transitiveCompileScopes;\n }\n\n const scopes: NgModuleTransitiveScopes = {\n compilation: {\n directives: new Set<any>(),\n pipes: new Set<any>(),\n },\n exported: {\n directives: new Set<any>(),\n pipes: new Set<any>(),\n },\n };\n\n def.declarations.forEach(declared => {\n const declaredWithDefs = declared as Type<any>& { ngPipeDef?: any; };\n\n if (declaredWithDefs.ngPipeDef !== undefined) {\n scopes.compilation.pipes.add(declared);\n } else {\n scopes.compilation.directives.add(declared);\n }\n });\n\n def.imports.forEach(<I>(imported: NgModuleType) => {\n const ngModule = resolvers.module.resolve(imported);\n\n if (ngModule === null) {\n throw new Error(`Importing ${imported.name} which does not have an @ngModule`);\n } else {\n this._compileNgModule(imported, resolvers);\n }\n\n // When this module imports another, the imported module's exported directives and pipes are\n // added to the compilation scope of this module.\n const importedScope = this._transitiveScopesFor(imported, resolvers);\n importedScope.exported.directives.forEach(entry => scopes.compilation.directives.add(entry));\n importedScope.exported.pipes.forEach(entry => scopes.compilation.pipes.add(entry));\n });\n\n def.exports.forEach(<E>(exported: Type<E>) => {\n const exportedTyped = exported as Type<E>& {\n // Components, Directives, NgModules, and Pipes can all be exported.\n ngComponentDef?: any;\n ngDirectiveDef?: any;\n ngModuleDef?: NgModuleDef<E>;\n ngPipeDef?: any;\n };\n\n // Either the type is a module, a pipe, or a component/directive (which may not have an\n // ngComponentDef as it might be compiled asynchronously).\n if (isNgModule(exportedTyped)) {\n // When this module exports another, the exported module's exported directives and pipes are\n // added to both the compilation and exported scopes of this module.\n const exportedScope = this._transitiveScopesFor(exportedTyped, resolvers);\n exportedScope.exported.directives.forEach(entry => {\n scopes.compilation.directives.add(entry);\n scopes.exported.directives.add(entry);\n });\n exportedScope.exported.pipes.forEach(entry => {\n scopes.compilation.pipes.add(entry);\n scopes.exported.pipes.add(entry);\n });\n } else if (exportedTyped.ngPipeDef !== undefined) {\n scopes.exported.pipes.add(exportedTyped);\n } else {\n scopes.exported.directives.add(exportedTyped);\n }\n });\n\n def.transitiveCompileScopes = scopes;\n return scopes;\n }\n}\n\nlet testBed: TestBedRender3;\n\nexport function _getTestBedRender3(): TestBedRender3 {\n return testBed = testBed || new TestBedRender3();\n}\n\nconst OWNER_MODULE = '__NG_MODULE__';\n/**\n * This function clears the OWNER_MODULE property from the Types. This is set in\n * r3/jit/modules.ts. It is common for the same Type to be compiled in different tests. If we don't\n * clear this we will get errors which will complain that the same Component/Directive is in more\n * than one NgModule.\n */\nfunction clearNgModules(type: Type<any>) {\n if (type.hasOwnProperty(OWNER_MODULE)) {\n (type as any)[OWNER_MODULE] = undefined;\n }\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 isNgModule<T>(value: Type<T>): value is Type<T>&{ngModuleDef: NgModuleDef<T>} {\n return (value as{ngModuleDef?: NgModuleDef<T>}).ngModuleDef !== undefined;\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, Injector, NgModule, NgModuleFactory, NgModuleRef, NgZone, Optional, Pipe, PlatformRef, Provider, SchemaMetadata, SkipSelf, StaticProvider, Type, ɵAPP_ROOT as APP_ROOT, ɵDepFlags as DepFlags, ɵInjectableDef as InjectableDef, ɵNodeFlags as NodeFlags, ɵclearOverrides as clearOverrides, ɵgetInjectableDef as getInjectableDef, ɵivyEnabled as ivyEnabled, ɵoverrideComponentView as overrideComponentView, ɵoverrideProvider as overrideProvider, ɵstringify as stringify} 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(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 /**\n * Overwrites all providers for the given token with the given provider definition.\n *\n * @deprecated as it makes all NgModules lazy. Introduced only for migrating off of it.\n */\n deprecatedOverrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): void;\n deprecatedOverrideProvider(token: any, provider: {useValue: any;}): void;\n deprecatedOverrideProvider(\n token: any, provider: {useFactory?: Function, useValue?: any, deps?: any[]}): void;\n\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 /**\n * Overwrites all providers for the given token with the given provider definition.\n *\n * @deprecated as it makes all NgModules lazy. Introduced only for migrating off of it.\n */\n static deprecatedOverrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): void;\n static deprecatedOverrideProvider(token: any, provider: {useValue: any;}): void;\n static deprecatedOverrideProvider(token: any, provider: {\n useFactory?: Function,\n useValue?: any,\n deps?: any[],\n }): TestBedStatic {\n _getTestBedViewEngine().deprecatedOverrideProvider(token, provider as any);\n return TestBedViewEngine as any as TestBedStatic;\n }\n\n static get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND) {\n return _getTestBedViewEngine().get(token, notFoundValue);\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(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): 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);\n return result === UNDEFINED ? this._compiler.injector.get(token, notFoundValue) : 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 /**\n * Overwrites all providers for the given token with the given provider definition.\n *\n * @deprecated as it makes all NgModules lazy. Introduced only for migrating off of it.\n */\n deprecatedOverrideProvider(token: any, provider: {\n useFactory: Function,\n deps: any[],\n }): void;\n deprecatedOverrideProvider(token: any, provider: {useValue: any;}): void;\n deprecatedOverrideProvider(\n token: any, provider: {useFactory?: Function, useValue?: any, deps?: any[]}): void {\n this.overrideProviderImpl(token, provider, /* deprecated */ true);\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 const noNgZone = this.get(ComponentFixtureNoNgZone, false);\n const autoDetect: boolean = this.get(ComponentFixtureAutoDetect, false);\n const ngZone: NgZone = noNgZone ? null : this.get(NgZone, 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 * @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","resetCompiledComponents","getInjectableDef","ComponentFactory","NgModuleRef","compileNgModuleDefs","compileComponent","compileDirective","compilePipe","patchComponentDefWithScope","_nextRootElementId","clearOverrides","tslib_1.__values","overrideComponentView","APP_ROOT","overrideProvider","ivyEnabled","testBed","_global"],"mappings":";;;;;;;;;AAAA;;;;;;;AAcA,IAAM,OAAO,IAAS,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAA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