Kargi-Sitesi/node_modules/@angular/platform-browser-dynamic/fesm2022/testing.mjs.map

1 line
6.9 KiB
Text
Raw Normal View History

2024-11-03 21:30:09 -05:00
{"version":3,"file":"testing.mjs","sources":["../../../../../../packages/platform-browser-dynamic/testing/src/dom_test_component_renderer.ts","../../../../../../packages/platform-browser-dynamic/testing/src/platform_core_dynamic_testing.ts","../../../../../../packages/platform-browser-dynamic/testing/src/testing.ts","../../../../../../packages/platform-browser-dynamic/testing/public_api.ts","../../../../../../packages/platform-browser-dynamic/testing/index.ts","../../../../../../packages/platform-browser-dynamic/testing/testing.ts"],"sourcesContent":["/**\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.dev/license\n */\n\nimport {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {TestComponentRenderer} from '@angular/core/testing';\n\n/**\n * A DOM based implementation of the TestComponentRenderer.\n */\n@Injectable()\nexport class DOMTestComponentRenderer extends TestComponentRenderer {\n constructor(@Inject(DOCUMENT) private _doc: any) {\n super();\n }\n\n override insertRootElement(rootElId: string) {\n this.removeAllRootElementsImpl();\n const rootElement = getDOM().getDefaultDocument().createElement('div');\n rootElement.setAttribute('id', rootElId);\n this._doc.body.appendChild(rootElement);\n }\n\n override removeAllRootElements() {\n // Check whether the `DOCUMENT` instance retrieved from DI contains\n // the necessary function to complete the cleanup. In tests that don't\n // interact with DOM, the `DOCUMENT` might be mocked and some functions\n // might be missing. For such tests, DOM cleanup is not required and\n // we skip the logic if there are missing functions.\n if (typeof this._doc.querySelectorAll === 'function') {\n this.removeAllRootElementsImpl();\n }\n }\n\n private removeAllRootElementsImpl() {\n const oldRoots = this._doc.querySelectorAll('[id^=root]');\n for (let i = 0; i < oldRoots.length; i++) {\n getDOM().remove(oldRoots[i]);\n }\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.dev/license\n */\n\nimport {createPlatformFactory, PlatformRef} from '@angular/core';\nimport {ɵplatformCoreDynamic as platformCoreDynamic} from '@angular/platform-browser-dynamic';\n\n/**\n * Platform for dynamic tests\n *\n * @publicApi\n */\nexport const platformCoreDynamicTesting: (extraProviders?: any[]) => PlatformRef =\n createPlatformFactory(platformCoreDynamic, 'coreDynamicTesting', []);\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.dev/license\n */\n\nimport {createPlatformFactory, NgModule, PlatformRef, StaticProvider} from '@angular/core';\nimport {TestComponentRenderer} from '@angular/core/testing';\nimport {ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS as INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from '@angular/platform-browser-dynamic';\nimport {BrowserTestingModule} from '@angular/platform-browser/testing';\n\nimport {DOMTestComponentRenderer} from './dom_test_component_renderer';\nimport {platformCoreDynamicTesting} from './platform_core_dynamic_testing';\n\nexport * from './private_export_testing';\n\n/**\n * @publicApi\n */\nexport const platformBrowserDynamicTesting = createPlatformFactory(\n platformCoreDynamicTesting,\n 'browserDynamicTesting',\n INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,\n);\n\n/**\n * NgModule for testing.\n *\n * @publicApi\n */\n@NgModule({\n exports: [BrowserTestingModule],\n providers: [{provide: TestComponentRenderer, useClass: DOMTestComponentRenderer}],\n})\nexport class BrowserDynamicTestingModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is