@@ -698,5 +698,77 @@ describe('Application Schematic', () => {
698
698
} ) ,
699
699
) ;
700
700
} ) ;
701
+
702
+ it ( 'should add provideExperimentalZonelessChangeDetection() in app.module.ts when experimentalZoneless is true' , async ( ) => {
703
+ const tree = await schematicRunner . runSchematic (
704
+ 'application' ,
705
+ {
706
+ ...defaultOptions ,
707
+ experimentalZoneless : true ,
708
+ standalone : false ,
709
+ } ,
710
+ workspaceTree ,
711
+ ) ;
712
+ const path = '/projects/foo/src/app/app.module.ts' ;
713
+ const fileContent = tree . readContent ( path ) ;
714
+ expect ( fileContent ) . toContain ( 'provideExperimentalZonelessChangeDetection()' ) ;
715
+ } ) ;
716
+
717
+ it ( 'should not add provideExperimentalZonelessChangeDetection() in app.module.ts when experimentalZoneless is false' , async ( ) => {
718
+ const tree = await schematicRunner . runSchematic (
719
+ 'application' ,
720
+ {
721
+ ...defaultOptions ,
722
+ experimentalZoneless : false ,
723
+ standalone : false ,
724
+ } ,
725
+ workspaceTree ,
726
+ ) ;
727
+ const path = '/projects/foo/src/app/app.module.ts' ;
728
+ const fileContent = tree . readContent ( path ) ;
729
+ expect ( fileContent ) . not . toContain ( 'provideExperimentalZonelessChangeDetection()' ) ;
730
+ } ) ;
731
+
732
+ it ( 'should add provideExperimentalZonelessChangeDetection() when experimentalZoneless is true' , async ( ) => {
733
+ const tree = await schematicRunner . runSchematic (
734
+ 'application' ,
735
+ {
736
+ ...defaultOptions ,
737
+ experimentalZoneless : true ,
738
+ } ,
739
+ workspaceTree ,
740
+ ) ;
741
+ const path = '/projects/foo/src/app/app.config.ts' ;
742
+ const fileContent = tree . readContent ( path ) ;
743
+ expect ( fileContent ) . toContain ( 'provideExperimentalZonelessChangeDetection()' ) ;
744
+ } ) ;
745
+
746
+ it ( 'should not add provideExperimentalZonelessChangeDetection() when experimentalZoneless is false' , async ( ) => {
747
+ const tree = await schematicRunner . runSchematic (
748
+ 'application' ,
749
+ {
750
+ ...defaultOptions ,
751
+ experimentalZoneless : false ,
752
+ } ,
753
+ workspaceTree ,
754
+ ) ;
755
+ const path = '/projects/foo/src/app/app.config.ts' ;
756
+ const fileContent = tree . readContent ( path ) ;
757
+ expect ( fileContent ) . not . toContain ( 'provideExperimentalZonelessChangeDetection()' ) ;
758
+ } ) ;
759
+
760
+ it ( 'should not add provideZoneChangeDetection when experimentalZoneless is true' , async ( ) => {
761
+ const tree = await schematicRunner . runSchematic (
762
+ 'application' ,
763
+ {
764
+ ...defaultOptions ,
765
+ experimentalZoneless : true ,
766
+ } ,
767
+ workspaceTree ,
768
+ ) ;
769
+ const path = '/projects/foo/src/app/app.config.ts' ;
770
+ const fileContent = tree . readContent ( path ) ;
771
+ expect ( fileContent ) . not . toContain ( 'provideZoneChangeDetection' ) ;
772
+ } ) ;
701
773
} ) ;
702
774
} ) ;
0 commit comments