11/**
2- * @license Angular v20.0.0-next.2+sha-c7cacbf
2+ * @license Angular v20.0.0-next.2+sha-0362665
33 * (c) 2010-2025 Google LLC. https://angular.io/
44 * License: MIT
55 */
66
77import * as i0 from '@angular/core' ;
8- import { Inject , Injectable , createPlatformFactory , NgModule } from '@angular/core' ;
9- import { TestComponentRenderer } from '@angular/core/testing' ;
8+ import { createPlatformFactory , NgModule } from '@angular/core' ;
109import { ɵplatformCoreDynamic as _platformCoreDynamic , ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS as _INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS } from '@angular/platform-browser-dynamic' ;
1110import { BrowserTestingModule } from '@angular/platform-browser/testing' ;
12- import { ɵgetDOM as _getDOM , DOCUMENT } from '@angular/common' ;
13-
14- /**
15- * A DOM based implementation of the TestComponentRenderer.
16- */
17- class DOMTestComponentRenderer extends TestComponentRenderer {
18- _doc ;
19- constructor ( _doc ) {
20- super ( ) ;
21- this . _doc = _doc ;
22- }
23- insertRootElement ( rootElId ) {
24- this . removeAllRootElementsImpl ( ) ;
25- const rootElement = _getDOM ( ) . getDefaultDocument ( ) . createElement ( 'div' ) ;
26- rootElement . setAttribute ( 'id' , rootElId ) ;
27- this . _doc . body . appendChild ( rootElement ) ;
28- }
29- removeAllRootElements ( ) {
30- // Check whether the `DOCUMENT` instance retrieved from DI contains
31- // the necessary function to complete the cleanup. In tests that don't
32- // interact with DOM, the `DOCUMENT` might be mocked and some functions
33- // might be missing. For such tests, DOM cleanup is not required and
34- // we skip the logic if there are missing functions.
35- if ( typeof this . _doc . querySelectorAll === 'function' ) {
36- this . removeAllRootElementsImpl ( ) ;
37- }
38- }
39- removeAllRootElementsImpl ( ) {
40- const oldRoots = this . _doc . querySelectorAll ( '[id^=root]' ) ;
41- for ( let i = 0 ; i < oldRoots . length ; i ++ ) {
42- _getDOM ( ) . remove ( oldRoots [ i ] ) ;
43- }
44- }
45- static ɵfac = i0 . ɵɵngDeclareFactory ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-c7cacbf" , ngImport : i0 , type : DOMTestComponentRenderer , deps : [ { token : DOCUMENT } ] , target : i0 . ɵɵFactoryTarget . Injectable } ) ;
46- static ɵprov = i0 . ɵɵngDeclareInjectable ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-c7cacbf" , ngImport : i0 , type : DOMTestComponentRenderer } ) ;
47- }
48- i0 . ɵɵngDeclareClassMetadata ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-c7cacbf" , ngImport : i0 , type : DOMTestComponentRenderer , decorators : [ {
49- type : Injectable
50- } ] , ctorParameters : ( ) => [ { type : undefined , decorators : [ {
51- type : Inject ,
52- args : [ DOCUMENT ]
53- } ] } ] } ) ;
11+ export { ɵDOMTestComponentRenderer } from '@angular/platform-browser/testing' ;
5412
5513/**
5614 * Platform for dynamic tests
@@ -69,17 +27,16 @@ const platformBrowserDynamicTesting = createPlatformFactory(platformCoreDynamicT
6927 * @publicApi
7028 */
7129class BrowserDynamicTestingModule {
72- static ɵfac = i0 . ɵɵngDeclareFactory ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-c7cacbf " , ngImport : i0 , type : BrowserDynamicTestingModule , deps : [ ] , target : i0 . ɵɵFactoryTarget . NgModule } ) ;
73- static ɵmod = i0 . ɵɵngDeclareNgModule ( { minVersion : "14.0.0" , version : "20.0.0-next.2+sha-c7cacbf " , ngImport : i0 , type : BrowserDynamicTestingModule , exports : [ BrowserTestingModule ] } ) ;
74- static ɵinj = i0 . ɵɵngDeclareInjector ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-c7cacbf " , ngImport : i0 , type : BrowserDynamicTestingModule , providers : [ { provide : TestComponentRenderer , useClass : DOMTestComponentRenderer } ] , imports : [ BrowserTestingModule ] } ) ;
30+ static ɵfac = i0 . ɵɵngDeclareFactory ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-0362665 " , ngImport : i0 , type : BrowserDynamicTestingModule , deps : [ ] , target : i0 . ɵɵFactoryTarget . NgModule } ) ;
31+ static ɵmod = i0 . ɵɵngDeclareNgModule ( { minVersion : "14.0.0" , version : "20.0.0-next.2+sha-0362665 " , ngImport : i0 , type : BrowserDynamicTestingModule , exports : [ BrowserTestingModule ] } ) ;
32+ static ɵinj = i0 . ɵɵngDeclareInjector ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-0362665 " , ngImport : i0 , type : BrowserDynamicTestingModule , imports : [ BrowserTestingModule ] } ) ;
7533}
76- i0 . ɵɵngDeclareClassMetadata ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-c7cacbf " , ngImport : i0 , type : BrowserDynamicTestingModule , decorators : [ {
34+ i0 . ɵɵngDeclareClassMetadata ( { minVersion : "12.0.0" , version : "20.0.0-next.2+sha-0362665 " , ngImport : i0 , type : BrowserDynamicTestingModule , decorators : [ {
7735 type : NgModule ,
7836 args : [ {
7937 exports : [ BrowserTestingModule ] ,
80- providers : [ { provide : TestComponentRenderer , useClass : DOMTestComponentRenderer } ] ,
8138 } ]
8239 } ] } ) ;
8340
84- export { BrowserDynamicTestingModule , platformBrowserDynamicTesting , DOMTestComponentRenderer as ɵDOMTestComponentRenderer , platformCoreDynamicTesting as ɵplatformCoreDynamicTesting } ;
41+ export { BrowserDynamicTestingModule , platformBrowserDynamicTesting , platformCoreDynamicTesting as ɵplatformCoreDynamicTesting } ;
8542//# sourceMappingURL=testing.mjs.map
0 commit comments