blob: 4630b6d63121536b4a75da8c2611e9114de485a1 [file] [log] [blame]
{"version":3,"sources":["packages/core/core-testing.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","core","testing","compiler","this","_global","window","runInTestZone","fn","context","finishCallback","failCallback","currentZone","Zone","current","AsyncTestZoneSpec","undefined","Error","ProxyZoneSpec","proxyZoneSpec","get","assertPresent","proxyZone","getZoneWith","previousDelegate","getDelegate","parent","run","testZoneSpec","setDelegate","error","runGuarded","ComponentFixture","componentRef","ngZone","_autoDetect","_this","_isStable","_isDestroyed","_resolve","_promise","_onUnstableSubscription","_onStableSubscription","_onMicrotaskEmptySubscription","_onErrorSubscription","changeDetectorRef","elementRef","location","debugElement","getDebugNode","nativeElement","componentInstance","instance","runOutsideAngular","onUnstable","subscribe","next","onMicrotaskEmpty","detectChanges","onStable","scheduleMicroTask","hasPendingMacrotasks","onError","prototype","_tick","checkNoChanges","autoDetectChanges","autoDetect","isStable","whenStable","Promise","resolve","res","_getRenderer","_renderer","injector","RendererFactory2","whenRenderingDone","renderer","destroy","unsubscribe","_Zone","FakeAsyncTestZoneSpec","_fakeAsyncTestZoneSpec","resetFakeAsyncZoneFallback","resetDelegate","_inFakeAsyncCall","_getFakeAsyncZoneSpec","flushMicrotasksFallback","flushMicrotasks","_Zone$1","fakeAsyncTestModule","__symbol__","resetFakeAsyncZone","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","create","__decorate","decorators","target","key","desc","c","arguments","length","r","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__awaiter","thisArg","_arguments","P","generator","reject","fulfilled","value","step","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","push","__values","o","m","__read","ar","__spread","concat","AsyncTestCompleter","rej","_reject","fail","stackTrace","enumerable","configurable","TestComponentRenderer","insertRootElement","rootElementId","ComponentFixtureAutoDetect","InjectionToken","ComponentFixtureNoNgZone","resolveComponentResources","resourceResolver","componentResolved","urlMap","Map","cachedResourceResolve","url","promise","resp","set","unwrapResponse","componentResourceResolutionQueue","forEach","component","type","promises","templateUrl","template","styleUrls","styles","styleOffset","styleUrl","index","style","splice","indexOf","fullyResolved","all","componentDefResolved","componentDefPendingResolution","delete","clearResolutionOfComponentResourcesQueue","Set","isComponentDefPendingResolution","has","old","response","text","_nextReferenceId","MetadataOverrider","_references","overrideMetadata","metadataClass","oldMetadata","override","props","_valueProps","obj","keys","prop","startsWith","proto","getPrototypeOf","protoProp","remove","add","ɵstringify","setMetadata","metadata","removeMetadata","references","removeObjects","_loop_1","removeValue","_propHashKey","_loop_2","propValue","filter","addMetadata","addValue","propName","JSON","stringify","_serializeReference","ref","id","TestingModuleOverride","reflection","ɵReflectionCapabilities","OverrideResolver","overrides","resolved","addOverride","setOverrides","clear","_a","_b","getAnnotation","annotations","annotation","Directive","Component","Pipe","NgModule","overrider_1","DirectiveResolver","_super","ComponentResolver","PipeResolver","NgModuleResolver","R3TestBedCompiler","platform","additionalModuleTypes","originalComponentResolutionQueue","declarations","imports","providers","schemas","pendingComponents","pendingDirectives","pendingPipes","seenComponents","seenDirectives","existingComponentStyles","resolvers","initResolvers","directive","pipe","componentToModuleScope","initialNgDefs","defCleanupOps","_injector","compilerProviders","providerOverrides","rootProviderOverrides","providerOverridesByToken","moduleProvidersOverridden","testModuleRef","testModuleType","DynamicTestModule","setCompilerProviders","configureTestingModule","moduleDef","_c","_d","queueTypeArray","DECLARATION","queueTypesFromModulesArray","overrideModule","ngModule","name","recompileNgModule","overrideComponent","overrideDirective","overridePipe","overrideProvider","token","provider","injectableDef","providerDef","useFactory","provide","deps","multi","useValue","ɵgetInjectableDef","providedIn","overrideTemplateUsingTestingModule","def","ɵNG_COMPONENT_DEF","overrideStyleUrls","OVERRIDE_TEMPLATE","compileComponents","resourceLoader_1","clearComponentResolutionQueue","compileTypesSync","ResourceLoader","finalize","compileTestModule","applyTransitiveScopes","applyProviderOverrides","patchComponentsWithExistingStyles","ɵRender3NgModuleRef","localeId","LOCALE_ID","ɵDEFAULT_LOCALE_ID","ɵsetLocaleId","ApplicationInitStatus","runInitializers","_compileNgModuleSync","moduleType","applyProviderOverridesToModule","_compileNgModuleAsync","_getModuleResolver","_getComponentFactories","maybeUnwrapFn","ngModuleDef","reduce","factories","declaration","componentDef","ngComponentDef","ɵRender3ComponentFactory","needsAsyncResources","maybeStoreNgDef","ɵcompileComponent","ɵNG_DIRECTIVE_DEF","ɵcompileDirective","ɵNG_PIPE_DEF","ɵcompilePipe","moduleToScope","componentType","moduleScope","realType","isTestingModuleOverride","ɵtransitiveScopesFor","getScopeOfModule","storeFieldOfDefOnType","ɵpatchComponentDefWithScope","maybeApplyOverrides","field","hasProviderOverrides","patchDefWithProviderOverrides","e_1","injectorDef","ɵNG_INJECTOR_DEF","size","getOverriddenProviders","ɵNG_MODULE_DEF","e_1_1","arr","e_2","arr_1","arr_1_1","isArray","queueType","e_2_1","ɵcompileNgModuleDefs","e_3","arr_2","arr_2_1","hasNgModuleDef","e_3_1","currentDef","defField","original","restoreComponentResolutionQueue","queue","restoreOriginalState","e_4","e_4_1","descriptor","RootScopeModule","NgZone","enableLongStackTrace","Compiler","R3TestCompiler","CompilerModule","COMPILER_OPTIONS","opts","CompilerModuleFactory","ɵNgModuleFactory","getSingleProviderOverrides","getProviderToken","getProviderOverrides","flatten","hasMultiProviderOverrides","some","isMultiProvider","overriddenProviders","final","seenMultiProviders","forEachRight","unshift","providersResolver","resolver_1","processProvidersFn_1","ngDef","maybeFn","Function","values","mapFn","out","getProviderField","idx","testBed","compileModuleSync","compileModuleAsync","compileModuleAndAllComponentsSync","ngModuleFactory","componentFactories","ModuleWithComponentFactories","compileModuleAndAllComponentsAsync","clearCache","clearCacheFor","getModuleId","meta","_nextRootElementId","UNDEFINED","TestBedRender3","_compiler","_testModuleRef","_activeFixtures","_globalCompilationChecked","initTestEnvironment","aotSummaries","_getTestBedRender3","resetTestEnvironment","configureCompiler","config","overrideTemplate","notFoundValue","flags","Injector","THROW_IF_NOT_FOUND","InjectFlags","Default","createComponent","resetTestingModule","checkGlobalCompilationFinished","ɵresetCompiledComponents","destroyActiveFixtures","useJit","assertNotInstantiated","execute","tokens","params","map","testComponentRenderer","rootElId","noNgZone","componentFactory","initComponent","NULL","fixture","methodName","methodDescription","ɵflushModuleScopingQueueAsMuchAsPossible","console","stacktrace","unimplemented","testBed$1","TestingCompiler","loadAotSummaries","summaries","getComponentFactory","getComponentFromError","Injectable","TestingCompilerFactory","UNDEFINED$1","_nextRootElementId$1","TestBedViewEngine","_instantiated","_moduleRef","_moduleFactory","_compilerOptions","_moduleOverrides","_componentOverrides","_directiveOverrides","_pipeOverrides","_providers","_declarations","_imports","_schemas","_testEnvAotSummaries","_aotSummaries","_templateOverrides","_isRoot","_rootProviderOverrides","_getTestBedViewEngine","getTestBed","ɵclearOverrides","_assertNotInstantiated","_createCompilerAndModule","moduleAndComponentFactories","_initIfNeeded","errorCompType","compFactory","templateOf","ɵoverrideComponentView","ngZoneInjector","TestBed","entry","rootScopeImports","jit","ɵAPP_ROOT","compilerFactory","createTestingCompiler","overrideProviderImpl","deprecated","dep","depToken","depFlags","Optional","SkipSelf","ɵoverrideProvider","deprecatedBehavior","OverrideComponent","selector","ɵivyEnabled","inject","completer","InjectSetupWrapper","_moduleDef","_addModule","_global$1","beforeEach","ɵangular_packages_core_testing_testing_b","ɵangular_packages_core_testing_testing_c","ɵangular_packages_core_testing_testing_a","withModule","ɵMetadataOverrider","async","asyncTest","asyncFallback","jasmine","err","fakeAsync","fakeAsyncFallback","args","_i","lastProxyZoneSpec","pendingPeriodicTimers","pendingTimers","tick","millis","tickFallback","flush","maxTurns","flushFallback","discardPeriodicTasks","discardPeriodicTasksFallback","__core_private_testing_placeholder__","ɵTestingCompiler","ɵTestingCompilerFactory"],"mappings":";;;;;CAMC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,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A3DmC,GA4D3C/lB,EAAQgmB,iBAAmB3F,GAC3BrgB,EAAQimB,wBAA0BtF,GAElCpa,OAAOuB,eAAe9H,EAAS,aAAc,CAAEsI,OAAO","sourcesContent":["/**\n * @license Angular v8.1.1\n * (c) 2010-2019 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/compiler')) :\n typeof define === 'function' && define.amd ? define('@angular/core/testing', ['exports', '@angular/core', '@angular/compiler'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.core = global.ng.core || {}, global.ng.core.testing = {}), global.ng.core, global.ng.compiler));\n}(this, function (exports, core, compiler) { 'use strict';\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 var _global = (typeof window === 'undefined' ? global : window);\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 */\n function asyncFallback(fn) {\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) {\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) { throw e; };\n }\n runInTestZone(fn, this, done, function (err) {\n if (typeof err === 'string') {\n return done.fail(new Error(err));\n }\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 var _this = this;\n return new Promise(function (finishCallback, failCallback) {\n runInTestZone(fn, _this, finishCallback, failCallback);\n });\n };\n }\n function runInTestZone(fn, context, finishCallback, failCallback) {\n var currentZone = Zone.current;\n var AsyncTestZoneSpec = Zone['AsyncTestZoneSpec'];\n if (AsyncTestZoneSpec === undefined) {\n throw new Error('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 var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n if (ProxyZoneSpec === undefined) {\n throw new Error('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 var 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 var proxyZone = Zone.current.getZoneWith('ProxyZoneSpec');\n var previousDelegate = proxyZoneSpec.getDelegate();\n proxyZone.parent.run(function () {\n var testZoneSpec = new AsyncTestZoneSpec(function () {\n // Need to restore the original zone.\n currentZone.run(function () {\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 }, function (error) {\n // Need to restore the original zone.\n currentZone.run(function () {\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 }, 'test');\n proxyZoneSpec.setDelegate(testZoneSpec);\n });\n return Zone.current.runGuarded(fn, context);\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 * 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 */\n function async(fn) {\n var _Zone = typeof Zone !== 'undefined' ? Zone : null;\n if (!_Zone) {\n return function () {\n return Promise.reject('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 var 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\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 * Fixture for debugging and testing a component.\n *\n * @publicApi\n */\n var ComponentFixture = /** @class */ (function () {\n function ComponentFixture(componentRef, ngZone, _autoDetect) {\n var _this = this;\n this.componentRef = componentRef;\n this.ngZone = ngZone;\n this._autoDetect = _autoDetect;\n this._isStable = true;\n this._isDestroyed = false;\n this._resolve = null;\n this._promise = null;\n this._onUnstableSubscription = null;\n this._onStableSubscription = null;\n this._onMicrotaskEmptySubscription = null;\n this._onErrorSubscription = null;\n this.changeDetectorRef = componentRef.changeDetectorRef;\n this.elementRef = componentRef.location;\n this.debugElement = core.getDebugNode(this.elementRef.nativeElement);\n this.componentInstance = componentRef.instance;\n this.nativeElement = this.elementRef.nativeElement;\n this.componentRef = componentRef;\n this.ngZone = ngZone;\n if (ngZone) {\n // Create subscriptions outside the NgZone so that the callbacks run oustide\n // of NgZone.\n ngZone.runOutsideAngular(function () {\n _this._onUnstableSubscription =\n ngZone.onUnstable.subscribe({ next: function () { _this._isStable = false; } });\n _this._onMicrotaskEmptySubscription = ngZone.onMicrotaskEmpty.subscribe({\n next: function () {\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: function () {\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(function () {\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 _this._onErrorSubscription =\n ngZone.onError.subscribe({ next: function (error) { throw error; } });\n });\n }\n }\n ComponentFixture.prototype._tick = function (checkNoChanges) {\n this.changeDetectorRef.detectChanges();\n if (checkNoChanges) {\n this.checkNoChanges();\n }\n };\n /**\n * Trigger a change detection cycle for the component.\n */\n ComponentFixture.prototype.detectChanges = function (checkNoChanges) {\n var _this = this;\n if (checkNoChanges === void 0) { checkNoChanges = true; }\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(function () { _this._tick(checkNoChanges); });\n }\n else {\n // Running without zone. Just do the change detection.\n this._tick(checkNoChanges);\n }\n };\n /**\n * Do a change detection run to make sure there were no changes.\n */\n ComponentFixture.prototype.checkNoChanges = function () { this.changeDetectorRef.checkNoChanges(); };\n /**\n * Set whether the fixture should autodetect changes.\n *\n * Also runs detectChanges once so that any existing change is detected.\n */\n ComponentFixture.prototype.autoDetectChanges = function (autoDetect) {\n if (autoDetect === void 0) { autoDetect = 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 * Return whether the fixture is currently stable or has async tasks that have not been completed\n * yet.\n */\n ComponentFixture.prototype.isStable = function () { return this._isStable && !this.ngZone.hasPendingMacrotasks; };\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 ComponentFixture.prototype.whenStable = function () {\n var _this = this;\n if (this.isStable()) {\n return Promise.resolve(false);\n }\n else if (this._promise !== null) {\n return this._promise;\n }\n else {\n this._promise = new Promise(function (res) { _this._resolve = res; });\n return this._promise;\n }\n };\n ComponentFixture.prototype._getRenderer = function () {\n if (this._renderer === undefined) {\n this._renderer = this.componentRef.injector.get(core.RendererFactory2, null);\n }\n return this._renderer;\n };\n /**\n * Get a promise that resolves when the ui state is stable following animations.\n */\n ComponentFixture.prototype.whenRenderingDone = function () {\n var renderer = this._getRenderer();\n if (renderer && renderer.whenRenderingDone) {\n return renderer.whenRenderingDone();\n }\n return this.whenStable();\n };\n /**\n * Trigger component destruction.\n */\n ComponentFixture.prototype.destroy = function () {\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 return ComponentFixture;\n }());\n function scheduleMicroTask(fn) {\n Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\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 * fakeAsync has been moved to zone.js\n * this file is for fallback in case old version of zone.js is used\n */\n var _Zone = typeof Zone !== 'undefined' ? Zone : null;\n var FakeAsyncTestZoneSpec = _Zone && _Zone['FakeAsyncTestZoneSpec'];\n var ProxyZoneSpec = _Zone && _Zone['ProxyZoneSpec'];\n var _fakeAsyncTestZoneSpec = null;\n /**\n * Clears out the shared fake async zone for a test.\n * To be called in a global `beforeEach`.\n *\n * @publicApi\n */\n 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 var _inFakeAsyncCall = false;\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 */\n function fakeAsyncFallback(fn) {\n // Not using an arrow function to preserve context passed from call site\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var 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 _fakeAsyncTestZoneSpec = new FakeAsyncTestZoneSpec();\n }\n var res = void 0;\n var lastProxyZoneSpec = proxyZoneSpec.getDelegate();\n proxyZoneSpec.setDelegate(_fakeAsyncTestZoneSpec);\n try {\n res = fn.apply(this, args);\n flushMicrotasksFallback();\n }\n finally {\n proxyZoneSpec.setDelegate(lastProxyZoneSpec);\n }\n if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {\n throw new Error(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length + \" \" +\n \"periodic timer(s) still in the queue.\");\n }\n if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {\n throw new Error(_fakeAsyncTestZoneSpec.pendingTimers.length + \" timer(s) still in the queue.\");\n }\n return res;\n }\n finally {\n _inFakeAsyncCall = false;\n resetFakeAsyncZoneFallback();\n }\n };\n }\n function _getFakeAsyncZoneSpec() {\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 * 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 */\n function tickFallback(millis) {\n if (millis === void 0) { millis = 0; }\n _getFakeAsyncZoneSpec().tick(millis);\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 */\n function flushFallback(maxTurns) {\n return _getFakeAsyncZoneSpec().flush(maxTurns);\n }\n /**\n * Discard all remaining periodic tasks.\n *\n * @publicApi\n */\n function discardPeriodicTasksFallback() {\n var zoneSpec = _getFakeAsyncZoneSpec();\n zoneSpec.pendingPeriodicTimers.length = 0;\n }\n /**\n * Flush any pending microtasks.\n *\n * @publicApi\n */\n function flushMicrotasksFallback() {\n _getFakeAsyncZoneSpec().flushMicrotasks();\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 var _Zone$1 = typeof Zone !== 'undefined' ? Zone : null;\n var fakeAsyncTestModule = _Zone$1 && _Zone$1[_Zone$1.__symbol__('fakeAsyncTest')];\n /**\n * Clears out the shared fake async zone for a test.\n * To be called in a global `beforeEach`.\n *\n * @publicApi\n */\n function resetFakeAsyncZone() {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.resetFakeAsyncZone();\n }\n else {\n return resetFakeAsyncZoneFallback();\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 */\n function fakeAsync(fn) {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.fakeAsync(fn);\n }\n else {\n return fakeAsyncFallback(fn);\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 */\n function tick(millis) {\n if (millis === void 0) { millis = 0; }\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.tick(millis);\n }\n else {\n return tickFallback(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 */\n function flush(maxTurns) {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.flush(maxTurns);\n }\n else {\n return flushFallback(maxTurns);\n }\n }\n /**\n * Discard all remaining periodic tasks.\n *\n * @publicApi\n */\n function discardPeriodicTasks() {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.discardPeriodicTasks();\n }\n else {\n discardPeriodicTasksFallback();\n }\n }\n /**\n * Flush any pending microtasks.\n *\n * @publicApi\n */\n function flushMicrotasks() {\n if (fakeAsyncTestModule) {\n return fakeAsyncTestModule.flushMicrotasks();\n }\n else {\n return flushMicrotasksFallback();\n }\n }\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n }\r\n\r\n function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n }\r\n\r\n function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n }\r\n\r\n function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n }\r\n\r\n function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n }\r\n\r\n function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\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 * Injectable completer that allows signaling completion of an asynchronous test. Used internally.\n */\n var AsyncTestCompleter = /** @class */ (function () {\n function AsyncTestCompleter() {\n var _this = this;\n this._promise = new Promise(function (res, rej) {\n _this._resolve = res;\n _this._reject = rej;\n });\n }\n AsyncTestCompleter.prototype.done = function (value) { this._resolve(value); };\n AsyncTestCompleter.prototype.fail = function (error, stackTrace) { this._reject(error); };\n Object.defineProperty(AsyncTestCompleter.prototype, \"promise\", {\n get: function () { return this._promise; },\n enumerable: true,\n configurable: true\n });\n return AsyncTestCompleter;\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 * An abstract class for inserting the root test component element in a platform independent way.\n *\n * @publicApi\n */\n var TestComponentRenderer = /** @class */ (function () {\n function TestComponentRenderer() {\n }\n TestComponentRenderer.prototype.insertRootElement = function (rootElementId) { };\n return TestComponentRenderer;\n }());\n /**\n * @publicApi\n */\n var ComponentFixtureAutoDetect = new core.InjectionToken('ComponentFixtureAutoDetect');\n /**\n * @publicApi\n */\n var ComponentFixtureNoNgZone = new core.InjectionToken('ComponentFixtureNoNgZone');\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 * 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 */\n function resolveComponentResources(resourceResolver) {\n // Store all promises which are fetching the resources.\n var componentResolved = [];\n // Cache so that we don't fetch the same resource more than once.\n var urlMap = new Map();\n function cachedResourceResolve(url) {\n var promise = urlMap.get(url);\n if (!promise) {\n var resp = resourceResolver(url);\n urlMap.set(url, promise = resp.then(unwrapResponse));\n }\n return promise;\n }\n componentResourceResolutionQueue.forEach(function (component, type) {\n var promises = [];\n if (component.templateUrl) {\n promises.push(cachedResourceResolve(component.templateUrl).then(function (template) {\n component.template = template;\n }));\n }\n var styleUrls = component.styleUrls;\n var styles = component.styles || (component.styles = []);\n var styleOffset = component.styles.length;\n styleUrls && styleUrls.forEach(function (styleUrl, index) {\n styles.push(''); // pre-allocate array.\n promises.push(cachedResourceResolve(styleUrl).then(function (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 var fullyResolved = Promise.all(promises).then(function () { return componentDefResolved(type); });\n componentResolved.push(fullyResolved);\n });\n clearResolutionOfComponentResourcesQueue();\n return Promise.all(componentResolved).then(function () { return undefined; });\n }\n var componentResourceResolutionQueue = new Map();\n // Track when existing ngComponentDef for a Type is waiting on resources.\n var componentDefPendingResolution = new Set();\n function isComponentDefPendingResolution(type) {\n return componentDefPendingResolution.has(type);\n }\n function clearResolutionOfComponentResourcesQueue() {\n var old = componentResourceResolutionQueue;\n componentResourceResolutionQueue = new Map();\n return old;\n }\n function restoreComponentResolutionQueue(queue) {\n componentDefPendingResolution.clear();\n queue.forEach(function (_, type) { return componentDefPendingResolution.add(type); });\n componentResourceResolutionQueue = queue;\n }\n function unwrapResponse(response) {\n return typeof response == 'string' ? response : response.text();\n }\n function componentDefResolved(type) {\n componentDefPendingResolution.delete(type);\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 var _nextReferenceId = 0;\n var MetadataOverrider = /** @class */ (function () {\n function MetadataOverrider() {\n this._references = new Map();\n }\n /**\n * Creates a new instance for the given metadata class\n * based on an old instance and overrides.\n */\n MetadataOverrider.prototype.overrideMetadata = function (metadataClass, oldMetadata, override) {\n var props = {};\n if (oldMetadata) {\n _valueProps(oldMetadata).forEach(function (prop) { return props[prop] = oldMetadata[prop]; });\n }\n if (override.set) {\n if (override.remove || override.add) {\n throw new Error(\"Cannot set and add/remove \" + core.ɵ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(props);\n };\n return MetadataOverrider;\n }());\n function removeMetadata(metadata, remove, references) {\n var removeObjects = new Set();\n var _loop_1 = function (prop) {\n var removeValue = remove[prop];\n if (removeValue instanceof Array) {\n removeValue.forEach(function (value) { removeObjects.add(_propHashKey(prop, value, references)); });\n }\n else {\n removeObjects.add(_propHashKey(prop, removeValue, references));\n }\n };\n for (var prop in remove) {\n _loop_1(prop);\n }\n var _loop_2 = function (prop) {\n var propValue = metadata[prop];\n if (propValue instanceof Array) {\n metadata[prop] = propValue.filter(function (value) { return !removeObjects.has(_propHashKey(prop, value, references)); });\n }\n else {\n if (removeObjects.has(_propHashKey(prop, propValue, references))) {\n metadata[prop] = undefined;\n }\n }\n };\n for (var prop in metadata) {\n _loop_2(prop);\n }\n }\n function addMetadata(metadata, add) {\n for (var prop in add) {\n var addValue = add[prop];\n var propValue = metadata[prop];\n if (propValue != null && propValue instanceof Array) {\n metadata[prop] = propValue.concat(addValue);\n }\n else {\n metadata[prop] = addValue;\n }\n }\n }\n function setMetadata(metadata, set) {\n for (var prop in set) {\n metadata[prop] = set[prop];\n }\n }\n function _propHashKey(propName, propValue, references) {\n var replacer = function (key, value) {\n if (typeof value === 'function') {\n value = _serializeReference(value, references);\n }\n return value;\n };\n return propName + \":\" + JSON.stringify(propValue, replacer);\n }\n function _serializeReference(ref, references) {\n var id = references.get(ref);\n if (!id) {\n id = \"\" + core.ɵstringify(ref) + _nextReferenceId++;\n references.set(ref, id);\n }\n return id;\n }\n function _valueProps(obj) {\n var props = [];\n // regular public props\n Object.keys(obj).forEach(function (prop) {\n if (!prop.startsWith('_')) {\n props.push(prop);\n }\n });\n // getters\n var proto = obj;\n while (proto = Object.getPrototypeOf(proto)) {\n Object.keys(proto).forEach(function (protoProp) {\n var 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 /**\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 var reflection = new core.ɵReflectionCapabilities();\n /**\n * Allows to override ivy metadata for tests (via the `TestBed`).\n */\n var OverrideResolver = /** @class */ (function () {\n function OverrideResolver() {\n this.overrides = new Map();\n this.resolved = new Map();\n }\n OverrideResolver.prototype.addOverride = function (type, override) {\n var overrides = this.overrides.get(type) || [];\n overrides.push(override);\n this.overrides.set(type, overrides);\n this.resolved.delete(type);\n };\n OverrideResolver.prototype.setOverrides = function (overrides) {\n var _this = this;\n this.overrides.clear();\n overrides.forEach(function (_a) {\n var _b = __read(_a, 2), type = _b[0], override = _b[1];\n _this.addOverride(type, override);\n });\n };\n OverrideResolver.prototype.getAnnotation = function (type) {\n var 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 (var i = annotations.length - 1; i >= 0; i--) {\n var annotation = annotations[i];\n var isKnownType = annotation instanceof core.Directive || annotation instanceof core.Component ||\n annotation instanceof core.Pipe || annotation instanceof core.NgModule;\n if (isKnownType) {\n return annotation instanceof this.type ? annotation : null;\n }\n }\n return null;\n };\n OverrideResolver.prototype.resolve = function (type) {\n var _this = this;\n var resolved = this.resolved.get(type) || null;\n if (!resolved) {\n resolved = this.getAnnotation(type);\n if (resolved) {\n var overrides = this.overrides.get(type);\n if (overrides) {\n var overrider_1 = new MetadataOverrider();\n overrides.forEach(function (override) {\n resolved = overrider_1.overrideMetadata(_this.type, resolved, override);\n });\n }\n }\n this.resolved.set(type, resolved);\n }\n return resolved;\n };\n return OverrideResolver;\n }());\n var DirectiveResolver = /** @class */ (function (_super) {\n __extends(DirectiveResolver, _super);\n function DirectiveResolver() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(DirectiveResolver.prototype, \"type\", {\n get: function () { return core.Directive; },\n enumerable: true,\n configurable: true\n });\n return DirectiveResolver;\n }(OverrideResolver));\n var ComponentResolver = /** @class */ (function (_super) {\n __extends(ComponentResolver, _super);\n function ComponentResolver() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ComponentResolver.prototype, \"type\", {\n get: function () { return core.Component; },\n enumerable: true,\n configurable: true\n });\n return ComponentResolver;\n }(OverrideResolver));\n var PipeResolver = /** @class */ (function (_super) {\n __extends(PipeResolver, _super);\n function PipeResolver() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(PipeResolver.prototype, \"type\", {\n get: function () { return core.Pipe; },\n enumerable: true,\n configurable: true\n });\n return PipeResolver;\n }(OverrideResolver));\n var NgModuleResolver = /** @class */ (function (_super) {\n __extends(NgModuleResolver, _super);\n function NgModuleResolver() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(NgModuleResolver.prototype, \"type\", {\n get: function () { return core.NgModule; },\n enumerable: true,\n configurable: true\n });\n return NgModuleResolver;\n }(OverrideResolver));\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 var TestingModuleOverride;\n (function (TestingModuleOverride) {\n TestingModuleOverride[TestingModuleOverride[\"DECLARATION\"] = 0] = \"DECLARATION\";\n TestingModuleOverride[TestingModuleOverride[\"OVERRIDE_TEMPLATE\"] = 1] = \"OVERRIDE_TEMPLATE\";\n })(TestingModuleOverride || (TestingModuleOverride = {}));\n function isTestingModuleOverride(value) {\n return value === TestingModuleOverride.DECLARATION ||\n value === TestingModuleOverride.OVERRIDE_TEMPLATE;\n }\n var R3TestBedCompiler = /** @class */ (function () {\n function R3TestBedCompiler(platform, additionalModuleTypes) {\n this.platform = platform;\n this.additionalModuleTypes = additionalModuleTypes;\n this.originalComponentResolutionQueue = null;\n // Testing module configuration\n this.declarations = [];\n this.imports = [];\n this.providers = [];\n this.schemas = [];\n // Queues of components/directives/pipes that should be recompiled.\n this.pendingComponents = new Set();\n this.pendingDirectives = new Set();\n this.pendingPipes = new Set();\n // Keep track of all components and directives, so we can patch Providers onto defs later.\n this.seenComponents = new Set();\n this.seenDirectives = new Set();\n // Store resolved styles for Components that have template overrides present and `styleUrls`\n // defined at the same time.\n this.existingComponentStyles = new Map();\n this.resolvers = initResolvers();\n this.componentToModuleScope = new Map();\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 this.initialNgDefs = new Map();\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 this.defCleanupOps = [];\n this._injector = null;\n this.compilerProviders = null;\n this.providerOverrides = [];\n this.rootProviderOverrides = [];\n this.providerOverridesByToken = new Map();\n this.moduleProvidersOverridden = new Set();\n this.testModuleRef = null;\n var DynamicTestModule = /** @class */ (function () {\n function DynamicTestModule() {\n }\n return DynamicTestModule;\n }());\n this.testModuleType = DynamicTestModule;\n }\n R3TestBedCompiler.prototype.setCompilerProviders = function (providers) {\n this.compilerProviders = providers;\n this._injector = null;\n };\n R3TestBedCompiler.prototype.configureTestingModule = function (moduleDef) {\n var _a, _b, _c, _d;\n // Enqueue any compilation tasks for the directly declared component.\n if (moduleDef.declarations !== undefined) {\n this.queueTypeArray(moduleDef.declarations, TestingModuleOverride.DECLARATION);\n (_a = this.declarations).push.apply(_a, __spread(moduleDef.declarations));\n }\n // Enqueue any compilation tasks for imported modules.\n if (moduleDef.imports !== undefined) {\n this.queueTypesFromModulesArray(moduleDef.imports);\n (_b = this.imports).push.apply(_b, __spread(moduleDef.imports));\n }\n if (moduleDef.providers !== undefined) {\n (_c = this.providers).push.apply(_c, __spread(moduleDef.providers));\n }\n if (moduleDef.schemas !== undefined) {\n (_d = this.schemas).push.apply(_d, __spread(moduleDef.schemas));\n }\n };\n R3TestBedCompiler.prototype.overrideModule = function (ngModule, override) {\n // Compile the module right away.\n this.resolvers.module.addOverride(ngModule, override);\n var 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 this.recompileNgModule(ngModule);\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 R3TestBedCompiler.prototype.overrideComponent = function (component, override) {\n this.resolvers.component.addOverride(component, override);\n this.pendingComponents.add(component);\n };\n R3TestBedCompiler.prototype.overrideDirective = function (directive, override) {\n this.resolvers.directive.addOverride(directive, override);\n this.pendingDirectives.add(directive);\n };\n R3TestBedCompiler.prototype.overridePipe = function (pipe, override) {\n this.resolvers.pipe.addOverride(pipe, override);\n this.pendingPipes.add(pipe);\n };\n R3TestBedCompiler.prototype.overrideProvider = function (token, provider) {\n var 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 var injectableDef;\n var isRoot = (typeof token !== 'string' && (injectableDef = core.ɵgetInjectableDef(token)) &&\n injectableDef.providedIn === 'root');\n var overridesBucket = isRoot ? this.rootProviderOverrides : this.providerOverrides;\n overridesBucket.push(providerDef);\n // Keep overrides grouped by token as well for fast lookups using token\n this.providerOverridesByToken.set(token, providerDef);\n };\n R3TestBedCompiler.prototype.overrideTemplateUsingTestingModule = function (type, template) {\n var _this = this;\n var def = type[core.ɵNG_COMPONENT_DEF];\n var hasStyleUrls = function () {\n var metadata = _this.resolvers.component.resolve(type);\n return !!metadata.styleUrls && metadata.styleUrls.length > 0;\n };\n var overrideStyleUrls = !!def && !isComponentDefPendingResolution(type) && hasStyleUrls();\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 var override = overrideStyleUrls ? { template: template, styles: [], styleUrls: [] } : { template: template };\n this.overrideComponent(type, { set: override });\n if (overrideStyleUrls && def.styles && def.styles.length > 0) {\n this.existingComponentStyles.set(type, def.styles);\n }\n // Set the component's scope to be the testing module.\n this.componentToModuleScope.set(type, TestingModuleOverride.OVERRIDE_TEMPLATE);\n };\n R3TestBedCompiler.prototype.compileComponents = function () {\n return __awaiter(this, void 0, void 0, function () {\n var needsAsyncResources, resourceLoader_1, resolver;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.clearComponentResolutionQueue();\n needsAsyncResources = this.compileTypesSync();\n if (!needsAsyncResources) return [3 /*break*/, 2];\n resolver = function (url) {\n if (!resourceLoader_1) {\n resourceLoader_1 = _this.injector.get(compiler.ResourceLoader);\n }\n return Promise.resolve(resourceLoader_1.get(url));\n };\n return [4 /*yield*/, resolveComponentResources(resolver)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n R3TestBedCompiler.prototype.finalize = function () {\n // One last compile\n this.compileTypesSync();\n // Create the testing module itself.\n this.compileTestModule();\n this.applyTransitiveScopes();\n this.applyProviderOverrides();\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 // Clear the componentToModuleScope map, so that future compilations don't reset the scope of\n // every component.\n this.componentToModuleScope.clear();\n var parentInjector = this.platform.injector;\n this.testModuleRef = new core.ɵRender3NgModuleRef(this.testModuleType, parentInjector);\n // Set the locale ID, it can be overridden for the tests\n var localeId = this.testModuleRef.injector.get(core.LOCALE_ID, core.ɵDEFAULT_LOCALE_ID);\n core.ɵsetLocaleId(localeId);\n // ApplicationInitStatus.runInitializers() is marked @internal to core.\n // Cast it to any before accessing it.\n this.testModuleRef.injector.get(core.ApplicationInitStatus).runInitializers();\n return this.testModuleRef;\n };\n /**\n * @internal\n */\n R3TestBedCompiler.prototype._compileNgModuleSync = function (moduleType) {\n this.queueTypesFromModulesArray([moduleType]);\n this.compileTypesSync();\n this.applyProviderOverrides();\n this.applyProviderOverridesToModule(moduleType);\n this.applyTransitiveScopes();\n };\n /**\n * @internal\n */\n R3TestBedCompiler.prototype._compileNgModuleAsync = function (moduleType) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.queueTypesFromModulesArray([moduleType]);\n return [4 /*yield*/, this.compileComponents()];\n case 1:\n _a.sent();\n this.applyProviderOverrides();\n this.applyProviderOverridesToModule(moduleType);\n this.applyTransitiveScopes();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * @internal\n */\n R3TestBedCompiler.prototype._getModuleResolver = function () { return this.resolvers.module; };\n /**\n * @internal\n */\n R3TestBedCompiler.prototype._getComponentFactories = function (moduleType) {\n var _this = this;\n return maybeUnwrapFn(moduleType.ngModuleDef.declarations).reduce(function (factories, declaration) {\n var componentDef = declaration.ngComponentDef;\n componentDef && factories.push(new core.ɵRender3ComponentFactory(componentDef, _this.testModuleRef));\n return factories;\n }, []);\n };\n R3TestBedCompiler.prototype.compileTypesSync = function () {\n var _this = this;\n // Compile all queued components, directives, pipes.\n var needsAsyncResources = false;\n this.pendingComponents.forEach(function (declaration) {\n needsAsyncResources = needsAsyncResources || isComponentDefPendingResolution(declaration);\n var metadata = _this.resolvers.component.resolve(declaration);\n _this.maybeStoreNgDef(core.ɵNG_COMPONENT_DEF, declaration);\n core.ɵcompileComponent(declaration, metadata);\n });\n this.pendingComponents.clear();\n this.pendingDirectives.forEach(function (declaration) {\n var metadata = _this.resolvers.directive.resolve(declaration);\n _this.maybeStoreNgDef(core.ɵNG_DIRECTIVE_DEF, declaration);\n core.ɵcompileDirective(declaration, metadata);\n });\n this.pendingDirectives.clear();\n this.pendingPipes.forEach(function (declaration) {\n var metadata = _this.resolvers.pipe.resolve(declaration);\n _this.maybeStoreNgDef(core.ɵNG_PIPE_DEF, declaration);\n core.ɵcompilePipe(declaration, metadata);\n });\n this.pendingPipes.clear();\n return needsAsyncResources;\n };\n R3TestBedCompiler.prototype.applyTransitiveScopes = function () {\n var _this = this;\n var moduleToScope = new Map();\n var getScopeOfModule = function (moduleType) {\n if (!moduleToScope.has(moduleType)) {\n var realType = isTestingModuleOverride(moduleType) ? _this.testModuleType : moduleType;\n moduleToScope.set(moduleType, core.ɵtransitiveScopesFor(realType));\n }\n return moduleToScope.get(moduleType);\n };\n this.componentToModuleScope.forEach(function (moduleType, componentType) {\n var moduleScope = getScopeOfModule(moduleType);\n _this.storeFieldOfDefOnType(componentType, core.ɵNG_COMPONENT_DEF, 'directiveDefs');\n _this.storeFieldOfDefOnType(componentType, core.ɵNG_COMPONENT_DEF, 'pipeDefs');\n core.ɵpatchComponentDefWithScope(componentType.ngComponentDef, moduleScope);\n });\n this.componentToModuleScope.clear();\n };\n R3TestBedCompiler.prototype.applyProviderOverrides = function () {\n var _this = this;\n var maybeApplyOverrides = function (field) { return function (type) {\n var resolver = field === core.ɵNG_COMPONENT_DEF ? _this.resolvers.component : _this.resolvers.directive;\n var metadata = resolver.resolve(type);\n if (_this.hasProviderOverrides(metadata.providers)) {\n _this.patchDefWithProviderOverrides(type, field);\n }\n }; };\n this.seenComponents.forEach(maybeApplyOverrides(core.ɵNG_COMPONENT_DEF));\n this.seenDirectives.forEach(maybeApplyOverrides(core.ɵNG_DIRECTIVE_DEF));\n this.seenComponents.clear();\n this.seenDirectives.clear();\n };\n R3TestBedCompiler.prototype.applyProviderOverridesToModule = function (moduleType) {\n var e_1, _a;\n if (this.moduleProvidersOverridden.has(moduleType)) {\n return;\n }\n this.moduleProvidersOverridden.add(moduleType);\n var injectorDef = moduleType[core.ɵNG_INJECTOR_DEF];\n if (this.providerOverridesByToken.size > 0) {\n if (this.hasProviderOverrides(injectorDef.providers)) {\n this.maybeStoreNgDef(core.ɵNG_INJECTOR_DEF, moduleType);\n this.storeFieldOfDefOnType(moduleType, core.ɵNG_INJECTOR_DEF, 'providers');\n injectorDef.providers = this.getOverriddenProviders(injectorDef.providers);\n }\n // Apply provider overrides to imported modules recursively\n var moduleDef = moduleType[core.ɵNG_MODULE_DEF];\n try {\n for (var _b = __values(moduleDef.imports), _c = _b.next(); !_c.done; _c = _b.next()) {\n var importType = _c.value;\n this.applyProviderOverridesToModule(importType);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n };\n R3TestBedCompiler.prototype.patchComponentsWithExistingStyles = function () {\n this.existingComponentStyles.forEach(function (styles, type) { return type[core.ɵNG_COMPONENT_DEF].styles = styles; });\n this.existingComponentStyles.clear();\n };\n R3TestBedCompiler.prototype.queueTypeArray = function (arr, moduleType) {\n var e_2, _a;\n try {\n for (var arr_1 = __values(arr), arr_1_1 = arr_1.next(); !arr_1_1.done; arr_1_1 = arr_1.next()) {\n var value = arr_1_1.value;\n if (Array.isArray(value)) {\n this.queueTypeArray(value, moduleType);\n }\n else {\n this.queueType(value, moduleType);\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (arr_1_1 && !arr_1_1.done && (_a = arr_1.return)) _a.call(arr_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n };\n R3TestBedCompiler.prototype.recompileNgModule = function (ngModule) {\n var 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(core.ɵNG_MODULE_DEF, ngModule);\n this.maybeStoreNgDef(core.ɵNG_INJECTOR_DEF, ngModule);\n core.ɵcompileNgModuleDefs(ngModule, metadata);\n };\n R3TestBedCompiler.prototype.queueType = function (type, moduleType) {\n var 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(core.ɵNG_COMPONENT_DEF)) {\n this.pendingComponents.add(type);\n }\n this.seenComponents.add(type);\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 var directive = this.resolvers.directive.resolve(type);\n if (directive) {\n if (!type.hasOwnProperty(core.ɵNG_DIRECTIVE_DEF)) {\n this.pendingDirectives.add(type);\n }\n this.seenDirectives.add(type);\n return;\n }\n var pipe = this.resolvers.pipe.resolve(type);\n if (pipe && !type.hasOwnProperty(core.ɵNG_PIPE_DEF)) {\n this.pendingPipes.add(type);\n return;\n }\n };\n R3TestBedCompiler.prototype.queueTypesFromModulesArray = function (arr) {\n var e_3, _a;\n try {\n for (var arr_2 = __values(arr), arr_2_1 = arr_2.next(); !arr_2_1.done; arr_2_1 = arr_2.next()) {\n var value = arr_2_1.value;\n if (Array.isArray(value)) {\n this.queueTypesFromModulesArray(value);\n }\n else if (hasNgModuleDef(value)) {\n var 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 catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (arr_2_1 && !arr_2_1.done && (_a = arr_2.return)) _a.call(arr_2);\n }\n finally { if (e_3) throw e_3.error; }\n }\n };\n R3TestBedCompiler.prototype.maybeStoreNgDef = function (prop, type) {\n if (!this.initialNgDefs.has(type)) {\n var currentDef = Object.getOwnPropertyDescriptor(type, prop);\n this.initialNgDefs.set(type, [prop, currentDef]);\n }\n };\n R3TestBedCompiler.prototype.storeFieldOfDefOnType = function (type, defField, field) {\n var def = type[defField];\n var original = def[field];\n this.defCleanupOps.push({ field: field, def: def, original: original });\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 R3TestBedCompiler.prototype.clearComponentResolutionQueue = function () {\n var _this = this;\n if (this.originalComponentResolutionQueue === null) {\n this.originalComponentResolutionQueue = new Map();\n }\n clearResolutionOfComponentResourcesQueue().forEach(function (value, key) { return _this.originalComponentResolutionQueue.set(key, value); });\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 R3TestBedCompiler.prototype.restoreComponentResolutionQueue = function () {\n if (this.originalComponentResolutionQueue !== null) {\n restoreComponentResolutionQueue(this.originalComponentResolutionQueue);\n this.originalComponentResolutionQueue = null;\n }\n };\n R3TestBedCompiler.prototype.restoreOriginalState = function () {\n var e_4, _a;\n try {\n for (var _b = __values(this.defCleanupOps), _c = _b.next(); !_c.done; _c = _b.next()) {\n var op = _c.value;\n op.def[op.field] = op.original;\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_4) throw e_4.error; }\n }\n // Restore initial component/directive/pipe defs\n this.initialNgDefs.forEach(function (value, type) {\n var _a = __read(value, 2), prop = _a[0], descriptor = _a[1];\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[prop];\n }\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 core.ɵsetLocaleId(core.ɵDEFAULT_LOCALE_ID);\n };\n R3TestBedCompiler.prototype.compileTestModule = function () {\n var _this = this;\n var RootScopeModule = /** @class */ (function () {\n function RootScopeModule() {\n }\n return RootScopeModule;\n }());\n core.ɵcompileNgModuleDefs(RootScopeModule, {\n providers: __spread(this.rootProviderOverrides),\n });\n var ngZone = new core.NgZone({ enableLongStackTrace: true });\n var providers = __spread([\n { provide: core.NgZone, useValue: ngZone },\n { provide: core.Compiler, useFactory: function () { return new R3TestCompiler(_this); } }\n ], this.providers, this.providerOverrides);\n var imports = [RootScopeModule, this.additionalModuleTypes, this.imports || []];\n // clang-format off\n core.ɵcompileNgModuleDefs(this.testModuleType, {\n declarations: this.declarations,\n imports: imports,\n schemas: this.schemas,\n providers: providers,\n }, /* allowDuplicateDeclarationsInRoot */ true);\n // clang-format on\n this.applyProviderOverridesToModule(this.testModuleType);\n };\n Object.defineProperty(R3TestBedCompiler.prototype, \"injector\", {\n get: function () {\n if (this._injector !== null) {\n return this._injector;\n }\n var providers = [];\n var compilerOptions = this.platform.injector.get(core.COMPILER_OPTIONS);\n compilerOptions.forEach(function (opts) {\n if (opts.providers) {\n providers.push(opts.providers);\n }\n });\n if (this.compilerProviders !== null) {\n providers.push.apply(providers, __spread(this.compilerProviders));\n }\n // TODO(ocombe): make this work with an Injector directly instead of creating a module for it\n var CompilerModule = /** @class */ (function () {\n function CompilerModule() {\n }\n return CompilerModule;\n }());\n core.ɵcompileNgModuleDefs(CompilerModule, { providers: providers });\n var CompilerModuleFactory = new core.ɵNgModuleFactory(CompilerModule);\n this._injector = CompilerModuleFactory.create(this.platform.injector).injector;\n return this._injector;\n },\n enumerable: true,\n configurable: true\n });\n // get overrides for a specific provider (if any)\n R3TestBedCompiler.prototype.getSingleProviderOverrides = function (provider) {\n var token = getProviderToken(provider);\n return this.providerOverridesByToken.get(token) || null;\n };\n R3TestBedCompiler.prototype.getProviderOverrides = function (providers) {\n var _this = this;\n if (!providers || !providers.length || this.providerOverridesByToken.size === 0)\n 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(providers, function (provider) { return _this.getSingleProviderOverrides(provider) || []; }));\n };\n R3TestBedCompiler.prototype.getOverriddenProviders = function (providers) {\n var _this = this;\n if (!providers || !providers.length || this.providerOverridesByToken.size === 0)\n return [];\n var overrides = this.getProviderOverrides(providers);\n var hasMultiProviderOverrides = overrides.some(isMultiProvider);\n var overriddenProviders = __spread(providers, overrides);\n // No additional processing is required in case we have no multi providers to override\n if (!hasMultiProviderOverrides) {\n return overriddenProviders;\n }\n var final = [];\n var seenMultiProviders = new Set();\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, function (provider) {\n var token = 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, function (value) {\n // Unwrap provider override array into individual providers in final set.\n final.unshift({ provide: token, useValue: value, multi: true });\n });\n }\n else {\n final.unshift(provider);\n }\n }\n }\n else {\n final.unshift(provider);\n }\n });\n return final;\n };\n R3TestBedCompiler.prototype.hasProviderOverrides = function (providers) {\n return this.getProviderOverrides(providers).length > 0;\n };\n R3TestBedCompiler.prototype.patchDefWithProviderOverrides = function (declaration, field) {\n var _this = this;\n var def = declaration[field];\n if (def && def.providersResolver) {\n this.maybeStoreNgDef(field, declaration);\n var resolver_1 = def.providersResolver;\n var processProvidersFn_1 = function (providers) { return _this.getOverriddenProviders(providers); };\n this.storeFieldOfDefOnType(declaration, field, 'providersResolver');\n def.providersResolver = function (ngDef) { return resolver_1(ngDef, processProvidersFn_1); };\n }\n };\n return R3TestBedCompiler;\n }());\n function initResolvers() {\n return {\n module: new NgModuleResolver(),\n component: new ComponentResolver(),\n directive: new DirectiveResolver(),\n pipe: new PipeResolver()\n };\n }\n function hasNgModuleDef(value) {\n return value.hasOwnProperty('ngModuleDef');\n }\n function maybeUnwrapFn(maybeFn) {\n return maybeFn instanceof Function ? maybeFn() : maybeFn;\n }\n function flatten(values, mapFn) {\n var out = [];\n values.forEach(function (value) {\n if (Array.isArray(value)) {\n out.push.apply(out, __spread(flatten(value, mapFn)));\n }\n else {\n out.push(mapFn ? mapFn(value) : value);\n }\n });\n return out;\n }\n function getProviderField(provider, field) {\n return provider && typeof provider === 'object' && provider[field];\n }\n function getProviderToken(provider) {\n return getProviderField(provider, 'provide') || provider;\n }\n function isMultiProvider(provider) {\n return !!getProviderField(provider, 'multi');\n }\n function forEachRight(values, fn) {\n for (var idx = values.length - 1; idx >= 0; idx--) {\n fn(values[idx], idx);\n }\n }\n var R3TestCompiler = /** @class */ (function () {\n function R3TestCompiler(testBed) {\n this.testBed = testBed;\n }\n R3TestCompiler.prototype.compileModuleSync = function (moduleType) {\n this.testBed._compileNgModuleSync(moduleType);\n return new core.ɵNgModuleFactory(moduleType);\n };\n R3TestCompiler.prototype.compileModuleAsync = function (moduleType) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.testBed._compileNgModuleAsync(moduleType)];\n case 1:\n _a.sent();\n return [2 /*return*/, new core.ɵNgModuleFactory(moduleType)];\n }\n });\n });\n };\n R3TestCompiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {\n var ngModuleFactory = this.compileModuleSync(moduleType);\n var componentFactories = this.testBed._getComponentFactories(moduleType);\n return new core.ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n };\n R3TestCompiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {\n return __awaiter(this, void 0, void 0, function () {\n var ngModuleFactory, componentFactories;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.compileModuleAsync(moduleType)];\n case 1:\n ngModuleFactory = _a.sent();\n componentFactories = this.testBed._getComponentFactories(moduleType);\n return [2 /*return*/, new core.ModuleWithComponentFactories(ngModuleFactory, componentFactories)];\n }\n });\n });\n };\n R3TestCompiler.prototype.clearCache = function () { };\n R3TestCompiler.prototype.clearCacheFor = function (type) { };\n R3TestCompiler.prototype.getModuleId = function (moduleType) {\n var meta = this.testBed._getModuleResolver().resolve(moduleType);\n return meta && meta.id || undefined;\n };\n return R3TestCompiler;\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 var _nextRootElementId = 0;\n var UNDEFINED = Symbol('UNDEFINED');\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 var TestBedRender3 = /** @class */ (function () {\n function TestBedRender3() {\n // Properties\n this.platform = null;\n this.ngModule = null;\n this._compiler = null;\n this._testModuleRef = null;\n this._activeFixtures = [];\n this._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 TestBedRender3.initTestEnvironment = function (ngModule, platform, aotSummaries) {\n var testBed = _getTestBedRender3();\n testBed.initTestEnvironment(ngModule, platform, aotSummaries);\n return testBed;\n };\n /**\n * Reset the providers for the test injector.\n *\n * @publicApi\n */\n TestBedRender3.resetTestEnvironment = function () { _getTestBedRender3().resetTestEnvironment(); };\n TestBedRender3.configureCompiler = function (config) {\n _getTestBedRender3().configureCompiler(config);\n return TestBedRender3;\n };\n /**\n * Allows overriding default providers, directives, pipes, modules of the test injector,\n * which are defined in test_injector.js\n */\n TestBedRender3.configureTestingModule = function (moduleDef) {\n _getTestBedRender3().configureTestingModule(moduleDef);\n return TestBedRender3;\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 TestBedRender3.compileComponents = function () { return _getTestBedRender3().compileComponents(); };\n TestBedRender3.overrideModule = function (ngModule, override) {\n _getTestBedRender3().overrideModule(ngModule, override);\n return TestBedRender3;\n };\n TestBedRender3.overrideComponent = function (component, override) {\n _getTestBedRender3().overrideComponent(component, override);\n return TestBedRender3;\n };\n TestBedRender3.overrideDirective = function (directive, override) {\n _getTestBedRender3().overrideDirective(directive, override);\n return TestBedRender3;\n };\n TestBedRender3.overridePipe = function (pipe, override) {\n _getTestBedRender3().overridePipe(pipe, override);\n return TestBedRender3;\n };\n TestBedRender3.overrideTemplate = function (component, template) {\n _getTestBedRender3().overrideComponent(component, { set: { template: template, templateUrl: null } });\n return TestBedRender3;\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 TestBedRender3.overrideTemplateUsingTestingModule = function (component, template) {\n _getTestBedRender3().overrideTemplateUsingTestingModule(component, template);\n return TestBedRender3;\n };\n TestBedRender3.overrideProvider = function (token, provider) {\n _getTestBedRender3().overrideProvider(token, provider);\n return TestBedRender3;\n };\n TestBedRender3.get = function (token, notFoundValue, flags) {\n if (notFoundValue === void 0) { notFoundValue = core.Injector.THROW_IF_NOT_FOUND; }\n if (flags === void 0) { flags = core.InjectFlags.Default; }\n return _getTestBedRender3().get(token, notFoundValue);\n };\n TestBedRender3.createComponent = function (component) {\n return _getTestBedRender3().createComponent(component);\n };\n TestBedRender3.resetTestingModule = function () {\n _getTestBedRender3().resetTestingModule();\n return TestBedRender3;\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 TestBedRender3.prototype.initTestEnvironment = function (ngModule, platform, aotSummaries) {\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 * Reset the providers for the test injector.\n *\n * @publicApi\n */\n TestBedRender3.prototype.resetTestEnvironment = function () {\n this.resetTestingModule();\n this._compiler = null;\n this.platform = null;\n this.ngModule = null;\n };\n TestBedRender3.prototype.resetTestingModule = function () {\n this.checkGlobalCompilationFinished();\n core.ɵ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 TestBedRender3.prototype.configureCompiler = function (config) {\n if (config.useJit != null) {\n throw new Error('the Render3 compiler JiT mode is not configurable !');\n }\n if (config.providers !== undefined) {\n this.compiler.setCompilerProviders(config.providers);\n }\n };\n TestBedRender3.prototype.configureTestingModule = function (moduleDef) {\n this.assertNotInstantiated('R3TestBed.configureTestingModule', 'configure the test module');\n this.compiler.configureTestingModule(moduleDef);\n };\n TestBedRender3.prototype.compileComponents = function () { return this.compiler.compileComponents(); };\n TestBedRender3.prototype.get = function (token, notFoundValue, flags) {\n if (notFoundValue === void 0) { notFoundValue = core.Injector.THROW_IF_NOT_FOUND; }\n if (flags === void 0) { flags = core.InjectFlags.Default; }\n if (token === TestBedRender3) {\n return this;\n }\n var result = this.testModuleRef.injector.get(token, UNDEFINED, flags);\n return result === UNDEFINED ? this.compiler.injector.get(token, notFoundValue, flags) : result;\n };\n TestBedRender3.prototype.execute = function (tokens, fn, context) {\n var _this = this;\n var params = tokens.map(function (t) { return _this.get(t); });\n return fn.apply(context, params);\n };\n TestBedRender3.prototype.overrideModule = function (ngModule, override) {\n this.assertNotInstantiated('overrideModule', 'override module metadata');\n this.compiler.overrideModule(ngModule, override);\n };\n TestBedRender3.prototype.overrideComponent = function (component, override) {\n this.assertNotInstantiated('overrideComponent', 'override component metadata');\n this.compiler.overrideComponent(component, override);\n };\n TestBedRender3.prototype.overrideTemplateUsingTestingModule = function (component, template) {\n this.assertNotInstantiated('R3TestBed.overrideTemplateUsingTestingModule', 'Cannot override template when the test module has already been instantiated');\n this.compiler.overrideTemplateUsingTestingModule(component, template);\n };\n TestBedRender3.prototype.overrideDirective = function (directive, override) {\n this.assertNotInstantiated('overrideDirective', 'override directive metadata');\n this.compiler.overrideDirective(directive, override);\n };\n TestBedRender3.prototype.overridePipe = function (pipe, override) {\n this.assertNotInstantiated('overridePipe', 'override pipe metadata');\n this.compiler.overridePipe(pipe, override);\n };\n /**\n * Overwrites all providers for the given token with the given provider definition.\n */\n TestBedRender3.prototype.overrideProvider = function (token, provider) {\n this.compiler.overrideProvider(token, provider);\n };\n TestBedRender3.prototype.createComponent = function (type) {\n var _this = this;\n var testComponentRenderer = this.get(TestComponentRenderer);\n var rootElId = \"root-ng-internal-isolated-\" + _nextRootElementId++;\n testComponentRenderer.insertRootElement(rootElId);\n var componentDef = type.ngComponentDef;\n if (!componentDef) {\n throw new Error(\"It looks like '\" + core.ɵstringify(type) + \"' has not been IVY compiled - it has no 'ngComponentDef' field\");\n }\n // TODO: Don't cast as `any`, proper type is boolean[]\n var noNgZone = this.get(ComponentFixtureNoNgZone, false);\n // TODO: Don't cast as `any`, proper type is boolean[]\n var autoDetect = this.get(ComponentFixtureAutoDetect, false);\n var ngZone = noNgZone ? null : this.get(core.NgZone, null);\n var componentFactory = new core.ɵRender3ComponentFactory(componentDef);\n var initComponent = function () {\n var componentRef = componentFactory.create(core.Injector.NULL, [], \"#\" + rootElId, _this.testModuleRef);\n return new ComponentFixture(componentRef, ngZone, autoDetect);\n };\n var fixture = ngZone ? ngZone.run(initComponent) : initComponent();\n this._activeFixtures.push(fixture);\n return fixture;\n };\n Object.defineProperty(TestBedRender3.prototype, \"compiler\", {\n get: function () {\n if (this._compiler === null) {\n throw new Error(\"Need to call TestBed.initTestEnvironment() first\");\n }\n return this._compiler;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TestBedRender3.prototype, \"testModuleRef\", {\n get: function () {\n if (this._testModuleRef === null) {\n this._testModuleRef = this.compiler.finalize();\n }\n return this._testModuleRef;\n },\n enumerable: true,\n configurable: true\n });\n TestBedRender3.prototype.assertNotInstantiated = function (methodName, methodDescription) {\n if (this._testModuleRef !== null) {\n throw new Error(\"Cannot \" + methodDescription + \" when the test module has already been instantiated. \" +\n (\"Make sure you are not using `inject` before `\" + methodName + \"`.\"));\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 TestBedRender3.prototype.checkGlobalCompilationFinished = function () {\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 core.ɵflushModuleScopingQueueAsMuchAsPossible();\n }\n this._globalCompilationChecked = true;\n };\n TestBedRender3.prototype.destroyActiveFixtures = function () {\n this._activeFixtures.forEach(function (fixture) {\n try {\n fixture.destroy();\n }\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 return TestBedRender3;\n }());\n var testBed;\n function _getTestBedRender3() {\n return testBed = testBed || new TestBedRender3();\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 function unimplemented() {\n throw Error('unimplemented');\n }\n /**\n * Special interface to the compiler only used by testing\n *\n * @publicApi\n */\n var TestingCompiler = /** @class */ (function (_super) {\n __extends(TestingCompiler, _super);\n function TestingCompiler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(TestingCompiler.prototype, \"injector\", {\n get: function () { throw unimplemented(); },\n enumerable: true,\n configurable: true\n });\n TestingCompiler.prototype.overrideModule = function (module, overrides) {\n throw unimplemented();\n };\n TestingCompiler.prototype.overrideDirective = function (directive, overrides) {\n throw unimplemented();\n };\n TestingCompiler.prototype.overrideComponent = function (component, overrides) {\n throw unimplemented();\n };\n TestingCompiler.prototype.overridePipe = function (directive, overrides) {\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 TestingCompiler.prototype.loadAotSummaries = function (summaries) { throw unimplemented(); };\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 TestingCompiler.prototype.getComponentFactory = function (component) { throw unimplemented(); };\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 TestingCompiler.prototype.getComponentFromError = function (error) { throw unimplemented(); };\n TestingCompiler = __decorate([\n core.Injectable()\n ], TestingCompiler);\n return TestingCompiler;\n }(core.Compiler));\n /**\n * A factory for creating a Compiler\n *\n * @publicApi\n */\n var TestingCompilerFactory = /** @class */ (function () {\n function TestingCompilerFactory() {\n }\n return TestingCompilerFactory;\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 var UNDEFINED$1 = new Object();\n var _nextRootElementId$1 = 0;\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 var TestBedViewEngine = /** @class */ (function () {\n function TestBedViewEngine() {\n this._instantiated = false;\n this._compiler = null;\n this._moduleRef = null;\n this._moduleFactory = null;\n this._compilerOptions = [];\n this._moduleOverrides = [];\n this._componentOverrides = [];\n this._directiveOverrides = [];\n this._pipeOverrides = [];\n this._providers = [];\n this._declarations = [];\n this._imports = [];\n this._schemas = [];\n this._activeFixtures = [];\n this._testEnvAotSummaries = function () { return []; };\n this._aotSummaries = [];\n this._templateOverrides = [];\n this._isRoot = true;\n this._rootProviderOverrides = [];\n this.platform = null;\n this.ngModule = 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 TestBedViewEngine.initTestEnvironment = function (ngModule, platform, aotSummaries) {\n var testBed = _getTestBedViewEngine();\n testBed.initTestEnvironment(ngModule, platform, aotSummaries);\n return testBed;\n };\n /**\n * Reset the providers for the test injector.\n */\n TestBedViewEngine.resetTestEnvironment = function () { _getTestBedViewEngine().resetTestEnvironment(); };\n TestBedViewEngine.resetTestingModule = function () {\n _getTestBedViewEngine().resetTestingModule();\n return TestBedViewEngine;\n };\n /**\n * Allows overriding default compiler providers and settings\n * which are defined in test_injector.js\n */\n TestBedViewEngine.configureCompiler = function (config) {\n _getTestBedViewEngine().configureCompiler(config);\n return TestBedViewEngine;\n };\n /**\n * Allows overriding default providers, directives, pipes, modules of the test injector,\n * which are defined in test_injector.js\n */\n TestBedViewEngine.configureTestingModule = function (moduleDef) {\n _getTestBedViewEngine().configureTestingModule(moduleDef);\n return TestBedViewEngine;\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 TestBedViewEngine.compileComponents = function () { return getTestBed().compileComponents(); };\n TestBedViewEngine.overrideModule = function (ngModule, override) {\n _getTestBedViewEngine().overrideModule(ngModule, override);\n return TestBedViewEngine;\n };\n TestBedViewEngine.overrideComponent = function (component, override) {\n _getTestBedViewEngine().overrideComponent(component, override);\n return TestBedViewEngine;\n };\n TestBedViewEngine.overrideDirective = function (directive, override) {\n _getTestBedViewEngine().overrideDirective(directive, override);\n return TestBedViewEngine;\n };\n TestBedViewEngine.overridePipe = function (pipe, override) {\n _getTestBedViewEngine().overridePipe(pipe, override);\n return TestBedViewEngine;\n };\n TestBedViewEngine.overrideTemplate = function (component, template) {\n _getTestBedViewEngine().overrideComponent(component, { set: { template: template, templateUrl: null } });\n return TestBedViewEngine;\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 TestBedViewEngine.overrideTemplateUsingTestingModule = function (component, template) {\n _getTestBedViewEngine().overrideTemplateUsingTestingModule(component, template);\n return TestBedViewEngine;\n };\n TestBedViewEngine.overrideProvider = function (token, provider) {\n _getTestBedViewEngine().overrideProvider(token, provider);\n return TestBedViewEngine;\n };\n TestBedViewEngine.get = function (token, notFoundValue, flags) {\n if (notFoundValue === void 0) { notFoundValue = core.Injector.THROW_IF_NOT_FOUND; }\n if (flags === void 0) { flags = core.InjectFlags.Default; }\n return _getTestBedViewEngine().get(token, notFoundValue, flags);\n };\n TestBedViewEngine.createComponent = function (component) {\n return _getTestBedViewEngine().createComponent(component);\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 TestBedViewEngine.prototype.initTestEnvironment = function (ngModule, platform, aotSummaries) {\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 * Reset the providers for the test injector.\n */\n TestBedViewEngine.prototype.resetTestEnvironment = function () {\n this.resetTestingModule();\n this.platform = null;\n this.ngModule = null;\n this._testEnvAotSummaries = function () { return []; };\n };\n TestBedViewEngine.prototype.resetTestingModule = function () {\n core.ɵclearOverrides();\n this._aotSummaries = [];\n this._templateOverrides = [];\n this._compiler = null;\n this._moduleOverrides = [];\n this._componentOverrides = [];\n this._directiveOverrides = [];\n this._pipeOverrides = [];\n this._isRoot = true;\n this._rootProviderOverrides = [];\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(function (fixture) {\n try {\n fixture.destroy();\n }\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 TestBedViewEngine.prototype.configureCompiler = function (config) {\n this._assertNotInstantiated('TestBed.configureCompiler', 'configure the compiler');\n this._compilerOptions.push(config);\n };\n TestBedViewEngine.prototype.configureTestingModule = function (moduleDef) {\n var _a, _b, _c, _d;\n this._assertNotInstantiated('TestBed.configureTestingModule', 'configure the test module');\n if (moduleDef.providers) {\n (_a = this._providers).push.apply(_a, __spread(moduleDef.providers));\n }\n if (moduleDef.declarations) {\n (_b = this._declarations).push.apply(_b, __spread(moduleDef.declarations));\n }\n if (moduleDef.imports) {\n (_c = this._imports).push.apply(_c, __spread(moduleDef.imports));\n }\n if (moduleDef.schemas) {\n (_d = this._schemas).push.apply(_d, __spread(moduleDef.schemas));\n }\n if (moduleDef.aotSummaries) {\n this._aotSummaries.push(moduleDef.aotSummaries);\n }\n };\n TestBedViewEngine.prototype.compileComponents = function () {\n var _this = this;\n if (this._moduleFactory || this._instantiated) {\n return Promise.resolve(null);\n }\n var moduleType = this._createCompilerAndModule();\n return this._compiler.compileModuleAndAllComponentsAsync(moduleType)\n .then(function (moduleAndComponentFactories) {\n _this._moduleFactory = moduleAndComponentFactories.ngModuleFactory;\n });\n };\n TestBedViewEngine.prototype._initIfNeeded = function () {\n var e_1, _a;\n if (this._instantiated) {\n return;\n }\n if (!this._moduleFactory) {\n try {\n var moduleType = this._createCompilerAndModule();\n this._moduleFactory =\n this._compiler.compileModuleAndAllComponentsSync(moduleType).ngModuleFactory;\n }\n catch (e) {\n var errorCompType = this._compiler.getComponentFromError(e);\n if (errorCompType) {\n throw new Error(\"This test module uses the component \" + core.ɵstringify(errorCompType) + \" which is using a \\\"templateUrl\\\" or \\\"styleUrls\\\", but they were never compiled. \" +\n \"Please call \\\"TestBed.compileComponents\\\" before your test.\");\n }\n else {\n throw e;\n }\n }\n }\n try {\n for (var _b = __values(this._templateOverrides), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = _c.value, component = _d.component, templateOf = _d.templateOf;\n var compFactory = this._compiler.getComponentFactory(templateOf);\n core.ɵoverrideComponentView(component, compFactory);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n var ngZone = new core.NgZone({ enableLongStackTrace: true });\n var providers = [{ provide: core.NgZone, useValue: ngZone }];\n var ngZoneInjector = core.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(core.ApplicationInitStatus).runInitializers();\n this._instantiated = true;\n };\n TestBedViewEngine.prototype._createCompilerAndModule = function () {\n var _this = this;\n var e_2, _a;\n var providers = this._providers.concat([{ provide: TestBed, useValue: this }]);\n var declarations = __spread(this._declarations, this._templateOverrides.map(function (entry) { return entry.templateOf; }));\n var rootScopeImports = [];\n var rootProviderOverrides = this._rootProviderOverrides;\n if (this._isRoot) {\n var RootScopeModule = /** @class */ (function () {\n function RootScopeModule() {\n }\n RootScopeModule = __decorate([\n core.NgModule({\n providers: __spread(rootProviderOverrides),\n jit: true,\n })\n ], RootScopeModule);\n return RootScopeModule;\n }());\n rootScopeImports.push(RootScopeModule);\n }\n providers.push({ provide: core.ɵAPP_ROOT, useValue: this._isRoot });\n var imports = [rootScopeImports, this.ngModule, this._imports];\n var schemas = this._schemas;\n var DynamicTestModule = /** @class */ (function () {\n function DynamicTestModule() {\n }\n DynamicTestModule = __decorate([\n core.NgModule({ providers: providers, declarations: declarations, imports: imports, schemas: schemas, jit: true })\n ], DynamicTestModule);\n return DynamicTestModule;\n }());\n var compilerFactory = this.platform.injector.get(TestingCompilerFactory);\n this._compiler = compilerFactory.createTestingCompiler(this._compilerOptions);\n try {\n for (var _b = __values(__spread([this._testEnvAotSummaries], this._aotSummaries)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var summary = _c.value;\n this._compiler.loadAotSummaries(summary);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n this._moduleOverrides.forEach(function (entry) { return _this._compiler.overrideModule(entry[0], entry[1]); });\n this._componentOverrides.forEach(function (entry) { return _this._compiler.overrideComponent(entry[0], entry[1]); });\n this._directiveOverrides.forEach(function (entry) { return _this._compiler.overrideDirective(entry[0], entry[1]); });\n this._pipeOverrides.forEach(function (entry) { return _this._compiler.overridePipe(entry[0], entry[1]); });\n return DynamicTestModule;\n };\n TestBedViewEngine.prototype._assertNotInstantiated = function (methodName, methodDescription) {\n if (this._instantiated) {\n throw new Error(\"Cannot \" + methodDescription + \" when the test module has already been instantiated. \" +\n (\"Make sure you are not using `inject` before `\" + methodName + \"`.\"));\n }\n };\n TestBedViewEngine.prototype.get = function (token, notFoundValue, flags) {\n if (notFoundValue === void 0) { notFoundValue = core.Injector.THROW_IF_NOT_FOUND; }\n if (flags === void 0) { flags = core.InjectFlags.Default; }\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 var result = this._moduleRef.injector.get(token, UNDEFINED$1, flags);\n return result === UNDEFINED$1 ? this._compiler.injector.get(token, notFoundValue, flags) : result;\n };\n TestBedViewEngine.prototype.execute = function (tokens, fn, context) {\n var _this = this;\n this._initIfNeeded();\n var params = tokens.map(function (t) { return _this.get(t); });\n return fn.apply(context, params);\n };\n TestBedViewEngine.prototype.overrideModule = function (ngModule, override) {\n this._assertNotInstantiated('overrideModule', 'override module metadata');\n this._moduleOverrides.push([ngModule, override]);\n };\n TestBedViewEngine.prototype.overrideComponent = function (component, override) {\n this._assertNotInstantiated('overrideComponent', 'override component metadata');\n this._componentOverrides.push([component, override]);\n };\n TestBedViewEngine.prototype.overrideDirective = function (directive, override) {\n this._assertNotInstantiated('overrideDirective', 'override directive metadata');\n this._directiveOverrides.push([directive, override]);\n };\n TestBedViewEngine.prototype.overridePipe = function (pipe, override) {\n this._assertNotInstantiated('overridePipe', 'override pipe metadata');\n this._pipeOverrides.push([pipe, override]);\n };\n TestBedViewEngine.prototype.overrideProvider = function (token, provider) {\n this.overrideProviderImpl(token, provider);\n };\n TestBedViewEngine.prototype.overrideProviderImpl = function (token, provider, deprecated) {\n if (deprecated === void 0) { deprecated = false; }\n var def = null;\n if (typeof token !== 'string' && (def = core.ɵgetInjectableDef(token)) && def.providedIn === 'root') {\n if (provider.useFactory) {\n this._rootProviderOverrides.push({ provide: token, useFactory: provider.useFactory, deps: provider.deps || [] });\n }\n else {\n this._rootProviderOverrides.push({ provide: token, useValue: provider.useValue });\n }\n }\n var flags = 0;\n var value;\n if (provider.useFactory) {\n flags |= 1024 /* TypeFactoryProvider */;\n value = provider.useFactory;\n }\n else {\n flags |= 256 /* TypeValueProvider */;\n value = provider.useValue;\n }\n var deps = (provider.deps || []).map(function (dep) {\n var depFlags = 0 /* None */;\n var depToken;\n if (Array.isArray(dep)) {\n dep.forEach(function (entry) {\n if (entry instanceof core.Optional) {\n depFlags |= 2 /* Optional */;\n }\n else if (entry instanceof core.SkipSelf) {\n depFlags |= 1 /* SkipSelf */;\n }\n else {\n depToken = entry;\n }\n });\n }\n else {\n depToken = dep;\n }\n return [depFlags, depToken];\n });\n core.ɵoverrideProvider({ token: token, flags: flags, deps: deps, value: value, deprecatedBehavior: deprecated });\n };\n TestBedViewEngine.prototype.overrideTemplateUsingTestingModule = function (component, template) {\n this._assertNotInstantiated('overrideTemplateUsingTestingModule', 'override template');\n var OverrideComponent = /** @class */ (function () {\n function OverrideComponent() {\n }\n OverrideComponent = __decorate([\n core.Component({ selector: 'empty', template: template, jit: true })\n ], OverrideComponent);\n return OverrideComponent;\n }());\n this._templateOverrides.push({ component: component, templateOf: OverrideComponent });\n };\n TestBedViewEngine.prototype.createComponent = function (component) {\n var _this = this;\n this._initIfNeeded();\n var componentFactory = this._compiler.getComponentFactory(component);\n if (!componentFactory) {\n throw new Error(\"Cannot create the component \" + core.ɵstringify(component) + \" as it was not imported into the testing module!\");\n }\n // TODO: Don't cast as `any`, proper type is boolean[]\n var noNgZone = this.get(ComponentFixtureNoNgZone, false);\n // TODO: Don't cast as `any`, proper type is boolean[]\n var autoDetect = this.get(ComponentFixtureAutoDetect, false);\n var ngZone = noNgZone ? null : this.get(core.NgZone, null);\n var testComponentRenderer = this.get(TestComponentRenderer);\n var rootElId = \"root\" + _nextRootElementId$1++;\n testComponentRenderer.insertRootElement(rootElId);\n var initComponent = function () {\n var componentRef = componentFactory.create(core.Injector.NULL, [], \"#\" + rootElId, _this._moduleRef);\n return new ComponentFixture(componentRef, ngZone, autoDetect);\n };\n var fixture = !ngZone ? initComponent() : ngZone.run(initComponent);\n this._activeFixtures.push(fixture);\n return fixture;\n };\n return TestBedViewEngine;\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 */\n var TestBed = core.ɵivyEnabled ? TestBedRender3 : TestBedViewEngine;\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 */\n var getTestBed = core.ɵivyEnabled ? _getTestBedRender3 : _getTestBedViewEngine;\n var testBed$1;\n function _getTestBedViewEngine() {\n return testBed$1 = testBed$1 || new TestBedViewEngine();\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 */\n function inject(tokens, fn) {\n var 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 var _this = this;\n // Return an async test method that returns a Promise if AsyncTestCompleter is one of\n // the injected tokens.\n return testBed.compileComponents().then(function () {\n var completer = testBed.get(AsyncTestCompleter);\n testBed.execute(tokens, fn, _this);\n return completer.promise;\n });\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 * @publicApi\n */\n var InjectSetupWrapper = /** @class */ (function () {\n function InjectSetupWrapper(_moduleDef) {\n this._moduleDef = _moduleDef;\n }\n InjectSetupWrapper.prototype._addModule = function () {\n var moduleDef = this._moduleDef();\n if (moduleDef) {\n getTestBed().configureTestingModule(moduleDef);\n }\n };\n InjectSetupWrapper.prototype.inject = function (tokens, fn) {\n var 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 return InjectSetupWrapper;\n }());\n function withModule(moduleDef, fn) {\n if (fn) {\n // Not using an arrow function to preserve context passed from call site\n return function () {\n var testBed = getTestBed();\n if (moduleDef) {\n testBed.configureTestingModule(moduleDef);\n }\n return fn.apply(this);\n };\n }\n return new InjectSetupWrapper(function () { return moduleDef; });\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 var _global$1 = (typeof window === 'undefined' ? global : window);\n // Reset the test providers and the fake async zone before each test.\n if (_global$1.beforeEach) {\n _global$1.beforeEach(function () {\n TestBed.resetTestingModule();\n resetFakeAsyncZone();\n });\n }\n // TODO(juliemr): remove this, only used because we need to export something to have compilation\n // work.\n var __core_private_testing_placeholder__ = '';\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 * @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 * @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 // This file only reexports content of the `src` folder. Keep it that way.\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 * Generated bundle index. Do not edit.\n */\n\n exports.ɵangular_packages_core_testing_testing_b = TestBedRender3;\n exports.ɵangular_packages_core_testing_testing_c = _getTestBedRender3;\n exports.ɵangular_packages_core_testing_testing_a = TestBedViewEngine;\n exports.TestBed = TestBed;\n exports.getTestBed = getTestBed;\n exports.inject = inject;\n exports.InjectSetupWrapper = InjectSetupWrapper;\n exports.withModule = withModule;\n exports.ɵMetadataOverrider = MetadataOverrider;\n exports.async = async;\n exports.ComponentFixture = ComponentFixture;\n exports.resetFakeAsyncZone = resetFakeAsyncZone;\n exports.fakeAsync = fakeAsync;\n exports.tick = tick;\n exports.flush = flush;\n exports.discardPeriodicTasks = discardPeriodicTasks;\n exports.flushMicrotasks = flushMicrotasks;\n exports.TestComponentRenderer = TestComponentRenderer;\n exports.ComponentFixtureAutoDetect = ComponentFixtureAutoDetect;\n exports.ComponentFixtureNoNgZone = ComponentFixtureNoNgZone;\n exports.__core_private_testing_placeholder__ = __core_private_testing_placeholder__;\n exports.ɵTestingCompiler = TestingCompiler;\n exports.ɵTestingCompilerFactory = TestingCompilerFactory;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n//# sourceMappingURL=core-testing.umd.js.map\n"]}