UNPKG

16 kBSource Map (JSON)View Raw
1{"version":3,"sources":["packages/upgrade/upgrade-static-testing.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","upgrade","static","testing","core","this","noNg","Error","noNgElement","cleanData","angular","bootstrap","element","injector","version","undefined","resumeBootstrap","getTestability","window","hasOwnProperty","_a","injector$1","AngularTestingModule","module_","prefix","dependencies","$injector","i","decorators","type","NgModule","args","providers","provide","useFactory","$injectorFactory","ctorParameters","Injector","createAngularJSTestingModule","angularModules","constant","TestBed","configureTestingModule","imports","useValue","inject","name","createAngularTestingModule","angularJSModules","strictDi","modules","ɵangular_packages_upgrade_static_testing_testing_a","ɵangular_packages_upgrade_static_testing_testing_b","ɵangular_packages_upgrade_static_testing_testing_d","Object","defineProperty","value"],"mappings":";;;;;CAMC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,iBAAkBA,QAAQ,0BAChG,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,kCAAmC,CAAC,UAAW,gBAAiB,yBAA0BJ,GACpHA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,QAAUT,EAAOQ,GAAGC,SAAW,GAAIT,EAAOQ,GAAGC,QAAQC,OAASV,EAAOQ,GAAGC,QAAQC,QAAU,GAAIV,EAAOQ,GAAGC,QAAQC,OAAOC,QAAU,IAAKX,EAAOQ,GAAGI,KAAMZ,EAAOQ,GAAGI,KAAKD,SAHnP,CAIEE,MAAM,SAAWX,EAASU,EAAMD,GAAW;;;;;;;OASzC,SAASG,IACL,MAAM,IAAIC,MAAM,iCAEpB,IAAIC,EAAc,WAAe,OAAOF,KACxCE,EAAYC,UAAYH,EACxB,IAAII,EAAU,CACVC,UAAWL,EACXX,OAAQW,EACRM,QAASJ,EACTK,SAAUP,EACVQ,aAASC,EACTC,gBAAiBV,EACjBW,eAAgBX,GAEpB,IACQY,OAAOC,eAAe,aACtBT,EAAUQ,OAAOR,SAGzB,MAAOU,IAqCP,IAkDIC,EAIAC,EAnDAC,EAAU,SAAUC,EAAQC,GAAgB,OAAOf,EAAQf,OAAO6B,EAAQC,IA8C1EC,EAAY,MAKZJ,EACA,SAASA,EAAqBK,GAC1BN,EAAaM,IAIAC,WAAa,CAC9B,CAAEC,KAAMzB,EAAK0B,SAAUC,KAAM,CAAC,CAAEC,UAAW,CAAC,CAAEC,QAvClC,YAuCsDC,WAVtE,SAASC,IACL,OAAOT,SAWXJ,EAAqBc,eAAiB,WAAc,MAAO,CACvD,CAAEP,KAAMzB,EAAKiC;;;;;;;;;;;;;;;AAyLjB3C,EAAQ4C;;;;;;;;AApCR,SAASA,EAA6BC,GAClC,OAAOhB,EAAQ,2BAA4B,IACtCiB,SAlLkB,0BAkLa,GAC/B/C,QAtLU,oBAsLY,CAlMf,YAoMR,SAAUiC,GAKN,OAJAvB,EAAQsC,QAAQC,uBAAuB,CACnCC,QAASJ,EACTP,UAAW,CAAC,CAAEC,QAvMd,YAuMkCW,SAAUlB,MAEzCvB,EAAQsC,QAAQI,OAAOzC,EAAKiC,aAGtCS,MAwBTpD,EAAQqD,2BAvHR,SAASA,EAA2BC,EAAkBC,GAKlD,OAJA1B,EAAQ,2BAA4ByB,GAC/BR,SAhGkB,0BAgGa,GAC/B/C,QApGU,qBAoGY,WAAc,OAAO4B,KAChDK,EAjIW,SAAUwB,EAASD,GAAY,OAAOvC,EAAQG,SAiIpC,CAAC,KAAM,4BAjI+CoC,GAiI/DpC,CAAS,EAAoCoC,GAClD3B,GAmHX5B,EAAQyD,mDAAqD5B,EAC7D7B,EAAQ0D,mDAvNmB,0BAwN3B1D,EAAQ2D,mDA3NW,oBA6NnBC,OAAOC,eAAe7D,EAAS,aAAc,CAAE8D,OAAO","sourcesContent":["/**\n * @license Angular v10.0.7\n * (c) 2010-2020 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/core/testing')) :\n typeof define === 'function' && define.amd ? define('@angular/upgrade/static/testing', ['exports', '@angular/core', '@angular/core/testing'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.upgrade = global.ng.upgrade || {}, global.ng.upgrade.static = global.ng.upgrade.static || {}, global.ng.upgrade.static.testing = {}), global.ng.core, global.ng.core.testing));\n}(this, (function (exports, core, testing) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC 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 noNg() {\n throw new Error('AngularJS v1.x is not loaded!');\n }\n var noNgElement = (function () { return noNg(); });\n noNgElement.cleanData = noNg;\n var angular = {\n bootstrap: noNg,\n module: noNg,\n element: noNgElement,\n injector: noNg,\n version: undefined,\n resumeBootstrap: noNg,\n getTestability: noNg\n };\n try {\n if (window.hasOwnProperty('angular')) {\n angular = window.angular;\n }\n }\n catch (_a) {\n // ignore in CJS mode.\n }\n /**\n * @deprecated Use `setAngularJSGlobal` instead.\n *\n * @publicApi\n */\n function setAngularLib(ng) {\n setAngularJSGlobal(ng);\n }\n /**\n * @deprecated Use `getAngularJSGlobal` instead.\n *\n * @publicApi\n */\n function getAngularLib() {\n return getAngularJSGlobal();\n }\n /**\n * Resets the AngularJS global.\n *\n * Used when AngularJS is loaded lazily, and not available on `window`.\n *\n * @publicApi\n */\n function setAngularJSGlobal(ng) {\n angular = ng;\n }\n /**\n * Returns the current AngularJS global.\n *\n * @publicApi\n */\n function getAngularJSGlobal() {\n return angular;\n }\n var bootstrap = function (e, modules, config) { return angular.bootstrap(e, modules, config); };\n // Do not declare as `module` to avoid webpack bug\n // (see https://github.com/angular/angular/issues/30050).\n var module_ = function (prefix, dependencies) { return angular.module(prefix, dependencies); };\n var element = (function (e) { return angular.element(e); });\n element.cleanData = function (nodes) { return angular.element.cleanData(nodes); };\n var injector = function (modules, strictDi) { return angular.injector(modules, strictDi); };\n var resumeBootstrap = function () { return angular.resumeBootstrap(); };\n var getTestability = function (e) { return angular.getTestability(e); };\n\n /**\n * @license\n * Copyright Google LLC 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 $COMPILE = '$compile';\n var $CONTROLLER = '$controller';\n var $DELEGATE = '$delegate';\n var $EXCEPTION_HANDLER = '$exceptionHandler';\n var $HTTP_BACKEND = '$httpBackend';\n var $INJECTOR = '$injector';\n var $INTERVAL = '$interval';\n var $PARSE = '$parse';\n var $PROVIDE = '$provide';\n var $ROOT_SCOPE = '$rootScope';\n var $SCOPE = '$scope';\n var $TEMPLATE_CACHE = '$templateCache';\n var $TEMPLATE_REQUEST = '$templateRequest';\n var $$TESTABILITY = '$$testability';\n var COMPILER_KEY = '$$angularCompiler';\n var DOWNGRADED_MODULE_COUNT_KEY = '$$angularDowngradedModuleCount';\n var GROUP_PROJECTABLE_NODES_KEY = '$$angularGroupProjectableNodes';\n var INJECTOR_KEY = '$$angularInjector';\n var LAZY_MODULE_REF = '$$angularLazyModuleRef';\n var NG_ZONE_KEY = '$$angularNgZone';\n var UPGRADE_APP_TYPE_KEY = '$$angularUpgradeAppType';\n var REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;\n var REQUIRE_NG_MODEL = '?ngModel';\n var UPGRADE_MODULE_NAME = '$$UpgradeModule';\n\n /**\n * @license\n * Copyright Google LLC 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 $injector = null;\n var injector$1;\n function $injectorFactory() {\n return $injector;\n }\n var AngularTestingModule = /** @class */ (function () {\n function AngularTestingModule(i) {\n injector$1 = i;\n }\n return AngularTestingModule;\n }());\n AngularTestingModule.decorators = [\n { type: core.NgModule, args: [{ providers: [{ provide: $INJECTOR, useFactory: $injectorFactory }] },] }\n ];\n AngularTestingModule.ctorParameters = function () { return [\n { type: core.Injector }\n ]; };\n /**\n * A helper function to use when unit testing Angular services that depend upon upgraded AngularJS\n * services.\n *\n * This function returns an `NgModule` decorated class that is configured to wire up the Angular\n * and AngularJS injectors without the need to actually bootstrap a hybrid application.\n * This makes it simpler and faster to unit test services.\n *\n * Use the returned class as an \"import\" when configuring the `TestBed`.\n *\n * In the following code snippet, we are configuring the TestBed with two imports.\n * The `Ng2AppModule` is the Angular part of our hybrid application and the `ng1AppModule` is the\n * AngularJS part.\n *\n * <code-example path=\"upgrade/static/ts/full/module.spec.ts\" region=\"angular-setup\"></code-example>\n *\n * Once this is done we can get hold of services via the Angular `Injector` as normal.\n * Services that are (or have dependencies on) an upgraded AngularJS service, will be instantiated\n * as needed by the AngularJS `$injector`.\n *\n * In the following code snippet, `HeroesService` is an Angular service that depends upon an\n * AngularJS service, `titleCase`.\n *\n * <code-example path=\"upgrade/static/ts/full/module.spec.ts\" region=\"angular-spec\"></code-example>\n *\n * <div class=\"alert is-important\">\n *\n * This helper is for testing services not Components.\n * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or\n * `downgradeModule` for more information.\n *\n * </div>\n *\n * <div class=\"alert is-important\">\n *\n * The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the\n * responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger\n * AngularJS handlers of async events from Angular.\n *\n * </div>\n *\n * <div class=\"alert is-important\">\n *\n * The helper sets up global variables to hold the shared Angular and AngularJS injectors.\n *\n * * Only call this helper once per spec.\n * * Do not use `createAngularTestingModule` in the same spec as `createAngularJSTestingModule`.\n *\n * </div>\n *\n * Here is the example application and its unit tests that use `createAngularTestingModule`\n * and `createAngularJSTestingModule`.\n *\n * <code-tabs>\n * <code-pane header=\"module.spec.ts\" path=\"upgrade/static/ts/full/module.spec.ts\"></code-pane>\n * <code-pane header=\"module.ts\" path=\"upgrade/static/ts/full/module.ts\"></code-pane>\n * </code-tabs>\n *\n *\n * @param angularJSModules a collection of the names of AngularJS modules to include in the\n * configuration.\n * @param [strictDi] whether the AngularJS injector should have `strictDI` enabled.\n *\n * @publicApi\n */\n function createAngularTestingModule(angularJSModules, strictDi) {\n module_('$$angularJSTestingModule', angularJSModules)\n .constant(UPGRADE_APP_TYPE_KEY, 2 /* Static */)\n .factory(INJECTOR_KEY, function () { return injector$1; });\n $injector = injector(['ng', '$$angularJSTestingModule'], strictDi);\n return AngularTestingModule;\n }\n\n /**\n * @license\n * Copyright Google LLC 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 * A helper function to use when unit testing AngularJS services that depend upon downgraded Angular\n * services.\n *\n * This function returns an AngularJS module that is configured to wire up the AngularJS and Angular\n * injectors without the need to actually bootstrap a hybrid application.\n * This makes it simpler and faster to unit test services.\n *\n * Use the returned AngularJS module in a call to\n * [`angular.mocks.module`](https://docs.angularjs.org/api/ngMock/function/angular.mock.module) to\n * include this module in the unit test injector.\n *\n * In the following code snippet, we are configuring the `$injector` with two modules:\n * The AngularJS `ng1AppModule`, which is the AngularJS part of our hybrid application and the\n * `Ng2AppModule`, which is the Angular part.\n *\n * <code-example path=\"upgrade/static/ts/full/module.spec.ts\"\n * region=\"angularjs-setup\"></code-example>\n *\n * Once this is done we can get hold of services via the AngularJS `$injector` as normal.\n * Services that are (or have dependencies on) a downgraded Angular service, will be instantiated as\n * needed by the Angular root `Injector`.\n *\n * In the following code snippet, `heroesService` is a downgraded Angular service that we are\n * accessing from AngularJS.\n *\n * <code-example path=\"upgrade/static/ts/full/module.spec.ts\"\n * region=\"angularjs-spec\"></code-example>\n *\n * <div class=\"alert is-important\">\n *\n * This helper is for testing services not components.\n * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or\n * `downgradeModule` for more information.\n *\n * </div>\n *\n * <div class=\"alert is-important\">\n *\n * The resulting configuration does not wire up AngularJS digests to Zone hooks. It is the\n * responsibility of the test writer to call `$rootScope.$apply`, as necessary, to trigger\n * AngularJS handlers of async events from Angular.\n *\n * </div>\n *\n * <div class=\"alert is-important\">\n *\n * The helper sets up global variables to hold the shared Angular and AngularJS injectors.\n *\n * * Only call this helper once per spec.\n * * Do not use `createAngularJSTestingModule` in the same spec as `createAngularTestingModule`.\n *\n * </div>\n *\n * Here is the example application and its unit tests that use `createAngularTestingModule`\n * and `createAngularJSTestingModule`.\n *\n * <code-tabs>\n * <code-pane header=\"module.spec.ts\" path=\"upgrade/static/ts/full/module.spec.ts\"></code-pane>\n * <code-pane header=\"module.ts\" path=\"upgrade/static/ts/full/module.ts\"></code-pane>\n * </code-tabs>\n *\n *\n * @param angularModules a collection of Angular modules to include in the configuration.\n *\n * @publicApi\n */\n function createAngularJSTestingModule(angularModules) {\n return module_('$$angularJSTestingModule', [])\n .constant(UPGRADE_APP_TYPE_KEY, 2 /* Static */)\n .factory(INJECTOR_KEY, [\n $INJECTOR,\n function ($injector) {\n testing.TestBed.configureTestingModule({\n imports: angularModules,\n providers: [{ provide: $INJECTOR, useValue: $injector }]\n });\n return testing.TestBed.inject(core.Injector);\n }\n ])\n .name;\n }\n\n /**\n * @license\n * Copyright Google LLC 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 LLC 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.createAngularJSTestingModule = createAngularJSTestingModule;\n exports.createAngularTestingModule = createAngularTestingModule;\n exports.ɵangular_packages_upgrade_static_testing_testing_a = module_;\n exports.ɵangular_packages_upgrade_static_testing_testing_b = UPGRADE_APP_TYPE_KEY;\n exports.ɵangular_packages_upgrade_static_testing_testing_d = INJECTOR_KEY;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=upgrade-static-testing.umd.js.map\n"]}
\No newline at end of file