@angular/core 8.0.0 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/core-testing.umd.js +1 -1
- package/bundles/core-testing.umd.min.js +1 -1
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +51 -39
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +74 -82
- package/bundles/core.umd.min.js.map +1 -1
- package/core.d.ts +17 -5
- package/core.metadata.json +1 -1
- package/esm2015/src/di/injectable.js +1 -1
- package/esm2015/src/render3/component_ref.js +2 -4
- package/esm2015/src/render3/index.js +1 -1
- package/esm2015/src/render3/instructions/all.js +2 -2
- package/esm2015/src/render3/instructions/projection.js +52 -13
- package/esm2015/src/render3/interfaces/projection.js +1 -1
- package/esm2015/src/render3/node_selector_matcher.js +2 -27
- package/esm2015/src/render3/styling/class_and_style_bindings.js +2 -2
- package/esm2015/src/version.js +1 -1
- package/esm5/src/di/injectable.js +1 -1
- package/esm5/src/render3/component_ref.js +2 -4
- package/esm5/src/render3/index.js +1 -1
- package/esm5/src/render3/instructions/projection.js +49 -14
- package/esm5/src/render3/interfaces/projection.js +1 -1
- package/esm5/src/render3/node_selector_matcher.js +2 -23
- package/esm5/src/render3/styling/class_and_style_bindings.js +2 -2
- package/esm5/src/version.js +1 -1
- package/fesm2015/core.js +54 -42
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/fesm5/core.js +51 -39
- package/fesm5/core.js.map +1 -1
- package/fesm5/testing.js +1 -1
- package/package.json +1 -1
- package/schematics/migrations/injectable-pipe/index.js +5 -2
- package/schematics/migrations/move-document/index.js +5 -2
- package/schematics/migrations/static-queries/index.js +5 -2
- package/schematics/migrations/template-var-assignment/index.js +6 -3
- package/src/r3_symbols.d.ts +1 -1
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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","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","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","compileComponents","resourceLoader_1","clearComponentResolutionQueue","compileTypesSync","ResourceLoader","finalize","compileTestModule","applyTransitiveScopes","applyProviderOverrides","patchComponentsWithExistingStyles","ɵRender3NgModuleRef","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","ɵ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,QAAQ,iBAAkBA,QAAQ,sBAChG,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,wBAAyB,CAAC,UAAW,gBAAiB,qBAAsBJ,GACtGA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAA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EjCd,EAAQ8kB,KApsER,SAASA,GAAKC,GAEV,YADe,IAAXA,IAAqBA,EAAS,GAC9B9e,EACOA,EAAoB6e,KAAKC,GArGxC,SAASC,EAAaD,QACH,IAAXA,IAAqBA,EAAS,GAClClf,IAAwBif,KAAKC,GAsGlBC,CAAaD,IA+rE5B/kB,EAAQilB,MAlrER,SAASA,GAAMC,GACX,OAAIjf,EACOA,EAAoBgf,MAAMC,GAzGzC,SAASC,EAAcD,GACnB,OAAOrf,IAAwBof,MAAMC,GA2G1BC,CAAcD,IA8qE7BllB,EAAQolB,qBAtqER,SAASA,KACL,GAAInf,EACA,OAAOA,EAAoBmf,wBA9GnC,SAASC,IACUxf,IACN+e,sBAAsBpd,OAAS,EA+GpC6d,IAkqERrlB,EAAQ+F,gBA1pER,SAASA,KACL,OAAIE,EACOA,EAAoBF,kBAGpBD,KAspEf9F,EAAQmL,sBAAwBA,EAChCnL,EAAQsL,2BAA6BA,EACrCtL,EAAQwL,yBAA2BA,EACnCxL,EAAQslB,qCA3DmC,GA4D3CtlB,EAAQulB,iBAAmB3F,GAC3B5f,EAAQwlB,wBAA0BtF,GAElC3Z,OAAOuB,eAAe9H,EAAS,aAAc,CAAEsI,OAAO","sourcesContent":["/**\n * @license Angular v8.0.0\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 TESTING_MODULE = 'TestingModule';\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, TESTING_MODULE);\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, TESTING_MODULE);\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 // 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 = moduleType === TESTING_MODULE ? _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. Only record this the first time, because it might be overridden by\n // overrideTemplateUsingTestingModule.\n if (!this.componentToModuleScope.has(type)) {\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 };\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 });\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"]}
|
|
1
|
+
{"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","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","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","compileComponents","resourceLoader_1","clearComponentResolutionQueue","compileTypesSync","ResourceLoader","finalize","compileTestModule","applyTransitiveScopes","applyProviderOverrides","patchComponentsWithExistingStyles","ɵRender3NgModuleRef","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","ɵ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,QAAQ,iBAAkBA,QAAQ,sBAChG,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,wBAAyB,CAAC,UAAW,gBAAiB,qBAAsBJ,GACtGA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,KAAOT,EAAOQ,GAAGC,MAAQ,GAAIT,EAAOQ,GAAGC,KAAKC,QAAU,IAAKV,EAAOQ,GAAGC,KAAMT,EAAOQ,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XA,IAAqBA,EAAS,GAClClf,IAAwBif,KAAKC,GAsGlBC,CAAaD,IA+rE5B/kB,EAAQilB,MAlrER,SAASA,GAAMC,GACX,OAAIjf,EACOA,EAAoBgf,MAAMC,GAzGzC,SAASC,EAAcD,GACnB,OAAOrf,IAAwBof,MAAMC,GA2G1BC,CAAcD,IA8qE7BllB,EAAQolB,qBAtqER,SAASA,KACL,GAAInf,EACA,OAAOA,EAAoBmf,wBA9GnC,SAASC,IACUxf,IACN+e,sBAAsBpd,OAAS,EA+GpC6d,IAkqERrlB,EAAQ+F,gBA1pER,SAASA,KACL,OAAIE,EACOA,EAAoBF,kBAGpBD,KAspEf9F,EAAQmL,sBAAwBA,EAChCnL,EAAQsL,2BAA6BA,EACrCtL,EAAQwL,yBAA2BA,EACnCxL,EAAQslB,qCA3DmC,GA4D3CtlB,EAAQulB,iBAAmB3F,GAC3B5f,EAAQwlB,wBAA0BtF,GAElC3Z,OAAOuB,eAAe9H,EAAS,aAAc,CAAEsI,OAAO","sourcesContent":["/**\n * @license Angular v8.0.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 TESTING_MODULE = 'TestingModule';\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, TESTING_MODULE);\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, TESTING_MODULE);\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 // 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 = moduleType === TESTING_MODULE ? _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. Only record this the first time, because it might be overridden by\n // overrideTemplateUsingTestingModule.\n if (!this.componentToModuleScope.has(type)) {\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 };\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 });\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"]}
|