diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app.component.spec.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app.component.spec.ts.template index 300f7b6466ae..273e49f1d2da 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/app/app.component.spec.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/app/app.component.spec.ts.template @@ -5,7 +5,7 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [AppComponent],<% if(experimentalZoneless) { %> + <% if(experimentalZoneless) { %> providers: [provideExperimentalZonelessChangeDetection()]<% } %> }).compileComponents(); }); diff --git a/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template b/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template index 070ef601b634..2e816c3b21a8 100644 --- a/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template +++ b/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template @@ -8,7 +8,7 @@ describe('<%= classify(name) %><%= classify(type) %>', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - <%= standalone ? 'imports' : 'declarations' %>: [<%= classify(name) %><%= classify(type) %>] + <%= standalone ? '' : 'declarations: [<%= classify(name) %><%= classify(type) %>]' %> }) .compileComponents();