@@ -625,7 +625,71 @@ exports[`app --strict should enable strict type checking: e2e tsconfig.json 1`]
625625}
626626` ;
627627
628- exports [` app --unit-test-runner vitest should add tsconfig.spec.json 1` ] = `
628+ exports [` app angular compat support should generate components with the "component" type for versions lower than v20 1` ] = `
629+ "import { Component } from '@angular/core';
630+ import { RouterModule } from '@angular/router';
631+ import { NxWelcomeComponent } from './nx-welcome.component';
632+
633+ @Component({
634+ imports : [NxWelcomeComponent , RouterModule ],
635+ selector : ' app-root' ,
636+ templateUrl : ' ./app.component.html' ,
637+ styleUrl : ' ./app.component.css' ,
638+ } )
639+ export class AppComponent {
640+ title = ' myapp' ;
641+ }
642+ "
643+ ` ;
644+
645+ exports [` app angular compat support should generate components with the "component" type for versions lower than v20 2` ] = `
646+ "<app-nx-welcome ></app-nx-welcome >
647+ <router-outlet ></router-outlet >
648+ "
649+ ` ;
650+
651+ exports [` app angular compat support should generate components with the "component" type for versions lower than v20 3` ] = `
652+ "import { TestBed } from '@angular/core/testing';
653+ import { AppComponent } from './app.component';
654+ import { NxWelcomeComponent } from './nx-welcome.component';
655+
656+ describe('AppComponent', () => {
657+ beforeEach (async () => {
658+ await TestBed .configureTestingModule ({
659+ imports: [AppComponent , NxWelcomeComponent ],
660+ }).compileComponents ();
661+ });
662+
663+ it (' should render title' , () => {
664+ const fixture = TestBed .createComponent (AppComponent );
665+ fixture .detectChanges ();
666+ const compiled = fixture .nativeElement as HTMLElement ;
667+ expect (compiled .querySelector (' h1' )? .textContent ).toContain (
668+ ' Welcome myapp'
669+ );
670+ });
671+
672+ it (\` should have as title 'myapp'\` , () => {
673+ const fixture = TestBed .createComponent (AppComponent );
674+ const app = fixture .componentInstance ;
675+ expect (app .title ).toEqual (' myapp' );
676+ } );
677+ });
678+ "
679+ ` ;
680+
681+ exports [` app angular compat support should generate components with the "component" type for versions lower than v20 4` ] = `
682+ "import { bootstrapApplication } from '@angular/platform-browser';
683+ import { appConfig } from './app/app.config';
684+ import { AppComponent } from './app/app.component';
685+
686+ bootstrapApplication(AppComponent, appConfig).catch((err) =>
687+ console.error(err)
688+ );
689+ "
690+ ` ;
691+
692+ exports [` app angular compat support vitest & angular < 21 should add tsconfig.spec.json 1` ] = `
629693"{
630694 " extends" : " ./tsconfig.json" ,
631695 " compilerOptions" : {
@@ -658,7 +722,7 @@ exports[`app --unit-test-runner vitest should add tsconfig.spec.json 1`] = `
658722"
659723` ;
660724
661- exports [` app --unit-test-runner vitest should generate src/test-setup.ts 1` ] = `
725+ exports [` app angular compat support vitest & angular < 21 should generate src/test-setup.ts 1` ] = `
662726"import '@angular/compiler';
663727import '@analogjs/vitest-angular/setup-zone';
664728
@@ -675,7 +739,7 @@ getTestBed().initTestEnvironment(
675739"
676740` ;
677741
678- exports [` app --unit-test-runner vitest should generate vite.config.mts 1` ] = `
742+ exports [` app angular compat support vitest & angular < 21 should generate vite.config.mts 1` ] = `
679743"/// <reference types = ' vitest' />
680744import { defineConfig } from 'vite';
681745import angular from '@analogjs/vite-plugin-angular';
@@ -707,70 +771,6 @@ export default defineConfig(() => ({
707771"
708772` ;
709773
710- exports [` app angular compat support should generate components with the "component" type for versions lower than v20 1` ] = `
711- "import { Component } from '@angular/core';
712- import { RouterModule } from '@angular/router';
713- import { NxWelcomeComponent } from './nx-welcome.component';
714-
715- @Component({
716- imports : [NxWelcomeComponent , RouterModule ],
717- selector : ' app-root' ,
718- templateUrl : ' ./app.component.html' ,
719- styleUrl : ' ./app.component.css' ,
720- } )
721- export class AppComponent {
722- title = ' myapp' ;
723- }
724- "
725- ` ;
726-
727- exports [` app angular compat support should generate components with the "component" type for versions lower than v20 2` ] = `
728- "<app-nx-welcome ></app-nx-welcome >
729- <router-outlet ></router-outlet >
730- "
731- ` ;
732-
733- exports [` app angular compat support should generate components with the "component" type for versions lower than v20 3` ] = `
734- "import { TestBed } from '@angular/core/testing';
735- import { AppComponent } from './app.component';
736- import { NxWelcomeComponent } from './nx-welcome.component';
737-
738- describe('AppComponent', () => {
739- beforeEach (async () => {
740- await TestBed .configureTestingModule ({
741- imports: [AppComponent , NxWelcomeComponent ],
742- }).compileComponents ();
743- });
744-
745- it (' should render title' , () => {
746- const fixture = TestBed .createComponent (AppComponent );
747- fixture .detectChanges ();
748- const compiled = fixture .nativeElement as HTMLElement ;
749- expect (compiled .querySelector (' h1' )? .textContent ).toContain (
750- ' Welcome myapp'
751- );
752- });
753-
754- it (\` should have as title 'myapp'\` , () => {
755- const fixture = TestBed .createComponent (AppComponent );
756- const app = fixture .componentInstance ;
757- expect (app .title ).toEqual (' myapp' );
758- } );
759- });
760- "
761- ` ;
762-
763- exports [` app angular compat support should generate components with the "component" type for versions lower than v20 4` ] = `
764- "import { bootstrapApplication } from '@angular/platform-browser';
765- import { appConfig } from './app/app.config';
766- import { AppComponent } from './app/app.component';
767-
768- bootstrapApplication(AppComponent, appConfig).catch((err) =>
769- console.error(err)
770- );
771- "
772- ` ;
773-
774774exports [` app at the root should accept numbers in the path 1` ] = ` "src/9-websites/my-app"` ;
775775
776776exports [` app format files should format files 1` ] = `
@@ -1091,11 +1091,11 @@ exports[`app not nested should generate files: tsconfig.app.json 1`] = `
10911091 " types" : [],
10921092 },
10931093 " exclude" : [
1094- " jest.config.ts" ,
1095- " src/test-setup.ts" ,
1096- " src/**/*.test.ts" ,
10971094 " src/**/*.spec.ts" ,
1095+ " src/**/*.test.ts" ,
1096+ " jest.config.ts" ,
10981097 " jest.config.cts" ,
1098+ " src/test-setup.ts" ,
10991099 ],
11001100 " extends" : " ./tsconfig.json" ,
11011101 " include" : [
0 commit comments