Skip to content

Commit 3eeea56

Browse files
JeanMechealxhub
authored andcommitted
refactor(core): remove compileComponents invocations (angular#61032)
Those weren't necessary. PR Close angular#61032
1 parent 108043f commit 3eeea56

File tree

32 files changed

+75
-79
lines changed

32 files changed

+75
-79
lines changed

adev/shared-docs/components/navigation-list/navigation-list.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('NavigationList', () => {
4343
{provide: NavigationState, useClass: FakeNavigationListState},
4444
provideZonelessChangeDetection(),
4545
],
46-
}).compileComponents();
46+
});
4747
fixture = TestBed.createComponent(NavigationList);
4848
fixture.componentRef.setInput('navigationItems', []);
4949

adev/shared-docs/components/table-of-contents/table-of-contents.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('TableOfContents', () => {
4949
useValue: fakeWindow,
5050
},
5151
],
52-
}).compileComponents();
52+
});
5353

5454
const tableOfContentsLoaderSpy = TestBed.inject(TableOfContentsLoader);
5555
spyOn(tableOfContentsLoaderSpy, 'buildTableOfContent').and.returnValue();

adev/shared-docs/components/viewers/docs-viewer/docs-viewer.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('DocViewer', () => {
8686
{provide: EXAMPLE_VIEWER_CONTENT_LOADER, useValue: exampleContentSpy},
8787
{provide: NavigationState, useValue: navigationStateSpy},
8888
],
89-
}).compileComponents();
89+
});
9090

9191
fixture = TestBed.createComponent(DocViewer);
9292
fixture.detectChanges();

adev/shared-docs/components/viewers/example-viewer/example-viewer.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('ExampleViewer', () => {
4040
{provide: EXAMPLE_VIEWER_CONTENT_LOADER, useValue: exampleContentSpy},
4141
{provide: ActivatedRoute, useValue: {snapshot: {fragment: 'fragment'}}},
4242
],
43-
}).compileComponents();
43+
});
4444
fixture = TestBed.createComponent(ExampleViewer);
4545
component = fixture.componentInstance;
4646
componentRef = fixture.componentRef;

adev/src/app/core/layout/navigation/navigation.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('Navigation', () => {
4949
useValue: fakeSearch,
5050
},
5151
],
52-
}).compileComponents();
52+
});
5353

5454
TestBed.overrideProvider(ThemeManager, {useValue: fakeThemeManager});
5555
TestBed.overrideProvider(VersionManager, {useValue: fakeVersionManager});

adev/src/app/core/layout/progress-bar/progress-bar.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('ProgressBarComponent', () => {
1818
beforeEach(async () => {
1919
await TestBed.configureTestingModule({
2020
imports: [ProgressBarComponent, RouterTestingModule],
21-
}).compileComponents();
21+
});
2222

2323
fixture = TestBed.createComponent(ProgressBarComponent);
2424
component = fixture.componentInstance;

adev/src/app/editor/code-editor/code-editor.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('CodeEditor', () => {
8080
},
8181
},
8282
],
83-
}).compileComponents();
83+
});
8484

8585
fixture = TestBed.createComponent(CodeEditor);
8686
loader = TestbedHarnessEnvironment.loader(fixture);

adev/src/app/editor/preview/preview.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('Preview', () => {
4343
useValue: fakeNodeRuntimeState,
4444
},
4545
],
46-
}).compileComponents();
46+
});
4747

4848
const fixture = TestBed.createComponent(Preview);
4949

adev/src/app/editor/terminal/terminal.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('Terminal', () => {
3636
useValue: fakeWindow,
3737
},
3838
],
39-
}).compileComponents();
39+
});
4040

4141
fixture = TestBed.createComponent(Terminal);
4242
component = fixture.componentInstance;

adev/src/app/features/home/animation/animation.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('Animation', () => {
8383
beforeEach(async () => {
8484
await TestBed.configureTestingModule({
8585
imports: [AnimationHost],
86-
}).compileComponents();
86+
});
8787

8888
fixture = TestBed.createComponent(AnimationHost);
8989
component = fixture.componentInstance;

adev/src/app/features/home/home.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
beforeEach(async () => {
2727
await TestBed.configureTestingModule({
2828
imports: [Home],
29-
}).compileComponents();
29+
});
3030
3131
TestBed.overrideProvider(HomeAnimation, {useValue: fakeHomeAnimation});
3232

adev/src/app/features/tutorial/tutorial.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('Tutorial', () => {
111111
},
112112
});
113113

114-
await TestBed.compileComponents();
114+
await TestBed;
115115

116116
fixture = TestBed.createComponent(Tutorial);
117117
component = fixture.componentInstance;

adev/src/content/examples/angular-compiler-options/src/app/app.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('AppComponent', () => {
55
beforeEach(async () => {
66
await TestBed.configureTestingModule({
77
declarations: [AppComponent],
8-
}).compileComponents();
8+
});
99
});
1010

1111
it('should create the app', () => {

adev/src/content/examples/forms-overview/src/app/app.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('AppComponent', () => {
88
beforeEach(waitForAsync(() => {
99
TestBed.configureTestingModule({
1010
declarations: [AppComponent],
11-
}).compileComponents();
11+
});
1212
}));
1313

1414
it('should create the app', waitForAsync(() => {

adev/src/content/examples/forms-overview/src/app/reactive/favorite-color/favorite-color.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Favorite Color Component', () => {
1010
beforeEach(waitForAsync(() => {
1111
TestBed.configureTestingModule({
1212
declarations: [FavoriteColorReactiveComponent],
13-
}).compileComponents();
13+
});
1414
}));
1515

1616
beforeEach(() => {

adev/src/content/examples/forms-overview/src/app/template/favorite-color/favorite-color.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('FavoriteColorComponent', () => {
1010
beforeEach(waitForAsync(() => {
1111
TestBed.configureTestingModule({
1212
declarations: [FavoriteColorTemplateComponent],
13-
}).compileComponents();
13+
});
1414
}));
1515

1616
beforeEach(() => {

adev/src/content/examples/schematics-for-libraries/projects/my-lib/src/lib/my-lib.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('MyLibComponent', () => {
77
let fixture: ComponentFixture<MyLibComponent>;
88

99
beforeEach(waitForAsync(() => {
10-
TestBed.configureTestingModule({declarations: [MyLibComponent]}).compileComponents();
10+
TestBed.configureTestingModule({declarations: [MyLibComponent]});
1111
}));
1212

1313
beforeEach(() => {

adev/src/content/examples/setup/src/app/app.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('AppComponent', () => {
1010
let fixture: ComponentFixture<AppComponent>;
1111

1212
beforeEach(waitForAsync(() => {
13-
TestBed.configureTestingModule({declarations: [AppComponent]}).compileComponents();
13+
TestBed.configureTestingModule({declarations: [AppComponent]});
1414
}));
1515

1616
beforeEach(() => {

adev/src/content/examples/testing/src/app/app-initial.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('AppComponent (initial CLI version)', () => {
1515
beforeEach(waitForAsync(() => {
1616
TestBed.configureTestingModule({
1717
imports: [AppComponent],
18-
}).compileComponents();
18+
});
1919
}));
2020
it('should create the app', waitForAsync(() => {
2121
const fixture = TestBed.createComponent(AppComponent);

adev/src/content/examples/testing/src/app/app.component.router.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('AppComponent & router testing', () => {
3939
]),
4040
],
4141
}),
42-
).compileComponents();
42+
);
4343
}));
4444

4545
it('should navigate to "Dashboard" immediately', fakeAsync(() => {
@@ -87,7 +87,7 @@ import {provideHttpClient} from '@angular/common/http';
8787
///////// Can't get lazy loaded Heroes to work yet
8888
xdescribe('AppComponent & Lazy Loading (not working yet)', () => {
8989
beforeEach(waitForAsync(() => {
90-
TestBed.configureTestingModule(appConfig).compileComponents();
90+
TestBed.configureTestingModule(appConfig);
9191
}));
9292

9393
beforeEach(fakeAsync(() => {

adev/src/content/examples/testing/src/app/app.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('AppComponent & TestModule', () => {
3838
}),
3939
)
4040
// #enddocregion testbed-stubs
41-
.compileComponents()
41+
4242
.then(() => {
4343
fixture = TestBed.createComponent(AppComponent);
4444
comp = fixture.componentInstance;
@@ -65,7 +65,7 @@ describe('AppComponent & NO_ERRORS_SCHEMA', () => {
6565
}),
6666
)
6767
// #enddocregion no-errors-schema, mixed-setup
68-
.compileComponents()
68+
6969
.then(() => {
7070
fixture = TestBed.createComponent(AppComponent);
7171
comp = fixture.componentInstance;

adev/src/content/examples/testing/src/app/banner/banner-external.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('BannerComponent (external files)', () => {
2828
beforeEach(async () => {
2929
await TestBed.configureTestingModule({
3030
imports: [BannerComponent],
31-
}).compileComponents(); // compile template and css
31+
}); // compile template and css
3232
});
3333
// #enddocregion async-before-each
3434

@@ -49,7 +49,7 @@ describe('BannerComponent (external files)', () => {
4949
beforeEach(async () => {
5050
await TestBed.configureTestingModule({
5151
imports: [BannerComponent],
52-
}).compileComponents();
52+
});
5353
fixture = TestBed.createComponent(BannerComponent);
5454
component = fixture.componentInstance;
5555
h1 = fixture.nativeElement.querySelector('h1');

adev/src/content/examples/testing/src/app/banner/banner-initial.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('BannerComponent (initial CLI generated)', () => {
2424
let fixture: ComponentFixture<BannerComponent>;
2525

2626
beforeEach(waitForAsync(() => {
27-
TestBed.configureTestingModule({imports: [BannerComponent]}).compileComponents();
27+
TestBed.configureTestingModule({imports: [BannerComponent]});
2828
}));
2929

3030
beforeEach(() => {

adev/src/content/examples/testing/src/app/dashboard/dashboard-hero.component.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ describe('DashboardHeroComponent when inside a test host', () => {
110110
TestBed.configureTestingModule({
111111
providers: appProviders,
112112
imports: [DashboardHeroComponent, TestHostComponent],
113-
})
114-
// #enddocregion test-host-setup
115-
.compileComponents();
113+
});
114+
// #enddocregion test-host-setup
116115
}));
117116

118117
beforeEach(() => {

adev/src/content/examples/testing/src/app/demo/demo.testbed.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ describe('demo (with TestBed):', () => {
162162
// beforeEach(waitForAsync(() => {
163163
// TestBed.configureTestingModule()
164164
// // Compile everything in DemoModule
165-
// .compileComponents();
165+
// ;
166166
// }));
167167

168168
it('should create a component with inline template', () => {

adev/src/content/examples/testing/src/app/hero/hero-detail.component.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ function overrideSetup() {
6767
// #docregion override-component-method
6868
.overrideComponent(HeroDetailComponent, {
6969
set: {providers: [{provide: HeroDetailService, useClass: HeroDetailServiceSpy}]},
70-
})
71-
// #enddocregion override-component-method
72-
.compileComponents();
70+
});
71+
// #enddocregion override-component-method
7372
});
7473
// #enddocregion setup-override
7574

@@ -137,7 +136,7 @@ function heroModuleSetup() {
137136
provideHttpClientTesting(),
138137
],
139138
}),
140-
).compileComponents();
139+
);
141140
});
142141
// #enddocregion setup-hero-module
143142

@@ -226,7 +225,7 @@ function formsModuleSetup() {
226225
provideRouter([{path: 'heroes/:id', component: HeroDetailComponent}]),
227226
],
228227
}),
229-
).compileComponents();
228+
);
230229
});
231230
// #enddocregion setup-forms-module
232231

@@ -252,7 +251,7 @@ function sharedModuleSetup() {
252251
provideHttpClientTesting(),
253252
],
254253
}),
255-
).compileComponents();
254+
);
256255
});
257256
// #enddocregion setup-shared-module
258257

adev/src/content/examples/testing/src/app/hero/hero-list.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('HeroListComponent', () => {
3434
],
3535
}),
3636
)
37-
.compileComponents()
37+
3838
.then(createComponent);
3939
}));
4040

adev/src/content/examples/testing/src/app/shared/canvas.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('CanvasComponent', () => {
2020
beforeEach(async () => {
2121
await TestBed.configureTestingModule({
2222
imports: [CanvasComponent],
23-
}).compileComponents();
23+
});
2424
});
2525

2626
it('should be able to generate blob data from canvas', fakeAsync(() => {

integration/platform-server-hydration/src/app/app.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import {TestBed} from '@angular/core/testing';
22
import {AppComponent} from './app.component';
33

44
describe('AppComponent', () => {
5-
beforeEach(async () => {
6-
await TestBed.configureTestingModule({
5+
beforeEach(() => {
6+
TestBed.configureTestingModule({
77
imports: [AppComponent],
8-
}).compileComponents();
8+
});
99
});
1010

1111
it('should create the app', () => {

integration/trusted-types/src/app/app.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import {RouterModule} from '@angular/router';
33
import {AppComponent} from './app.component';
44

55
describe('AppComponent', () => {
6-
beforeEach(async () => {
7-
await TestBed.configureTestingModule({
6+
beforeEach(() => {
7+
TestBed.configureTestingModule({
88
imports: [RouterModule.forRoot([])],
99
declarations: [AppComponent],
10-
}).compileComponents();
10+
});
1111
});
1212

1313
it('should create the app', () => {

packages/core/test/acceptance/signal_debug_spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('getSignalGraph', () => {
9494
);
9595
}
9696
}
97-
TestBed.configureTestingModule({imports: [WithEffect]}).compileComponents();
97+
TestBed.configureTestingModule({imports: [WithEffect]});
9898
const fixture = TestBed.createComponent(WithEffect);
9999

100100
tick();
@@ -131,7 +131,7 @@ describe('getSignalGraph', () => {
131131
debugName: 'computedSignal',
132132
});
133133
}
134-
TestBed.configureTestingModule({imports: [WithComputed]}).compileComponents();
134+
TestBed.configureTestingModule({imports: [WithComputed]});
135135
const fixture = TestBed.createComponent(WithComputed);
136136

137137
tick();
@@ -192,7 +192,7 @@ describe('getSignalGraph', () => {
192192
debugName: 'computedSignal',
193193
});
194194
}
195-
TestBed.configureTestingModule({imports: [WithUnusedReactiveNodes]}).compileComponents();
195+
TestBed.configureTestingModule({imports: [WithUnusedReactiveNodes]});
196196
const fixture = TestBed.createComponent(WithUnusedReactiveNodes);
197197

198198
tick();
@@ -212,7 +212,7 @@ describe('getSignalGraph', () => {
212212
primitiveSignal = signal(123, {debugName: 'primitiveSignal'});
213213
primitiveSignalEffect = effect(() => {}, {debugName: 'primitiveSignalEffect'});
214214
}
215-
TestBed.configureTestingModule({imports: [WithNoEffectSignalDependencies]}).compileComponents();
215+
TestBed.configureTestingModule({imports: [WithNoEffectSignalDependencies]});
216216
const fixture = TestBed.createComponent(WithNoEffectSignalDependencies);
217217

218218
tick();
@@ -229,7 +229,7 @@ describe('getSignalGraph', () => {
229229
it('should return the signal graph for a component with no signal dependencies in the template or component effects', fakeAsync(() => {
230230
@Component({selector: 'component-with-no-effect-dependencies', template: ``})
231231
class WithNoEffectDependencies {}
232-
TestBed.configureTestingModule({imports: [WithNoEffectDependencies]}).compileComponents();
232+
TestBed.configureTestingModule({imports: [WithNoEffectDependencies]});
233233
const fixture = TestBed.createComponent(WithNoEffectDependencies);
234234

235235
tick();
@@ -267,7 +267,7 @@ describe('getSignalGraph', () => {
267267
);
268268
}
269269
}
270-
TestBed.configureTestingModule({imports: [WithExternalService]}).compileComponents();
270+
TestBed.configureTestingModule({imports: [WithExternalService]});
271271
const fixture = TestBed.createComponent(WithExternalService);
272272

273273
tick();

0 commit comments

Comments
 (0)