Skip to content

Commit 4718718

Browse files
authored
test: remove compileComponent calls (angular#29535)
Calls to `compileComponent` aren't necessary in the vast majority of cases. These changes clean them up frm our codebase.
1 parent 78c6941 commit 4718718

File tree

187 files changed

+438
-625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+438
-625
lines changed

src/cdk-experimental/combobox/combobox.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Combobox', () => {
2626
beforeEach(waitForAsync(() => {
2727
TestBed.configureTestingModule({
2828
imports: [CdkComboboxModule, ComboboxToggle],
29-
}).compileComponents();
29+
});
3030
}));
3131

3232
beforeEach(() => {
@@ -192,7 +192,7 @@ describe('Combobox', () => {
192192
beforeEach(waitForAsync(() => {
193193
TestBed.configureTestingModule({
194194
imports: [CdkComboboxModule, ComboboxToggle],
195-
}).compileComponents();
195+
});
196196
}));
197197

198198
beforeEach(() => {
@@ -262,7 +262,7 @@ describe('Combobox', () => {
262262
beforeEach(waitForAsync(() => {
263263
TestBed.configureTestingModule({
264264
imports: [CdkComboboxModule, ComboboxToggle],
265-
}).compileComponents();
265+
});
266266
}));
267267

268268
beforeEach(() => {

src/cdk-experimental/popover-edit/popover-edit.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ describe('CDK Popover Edit', () => {
397397
TestBed.configureTestingModule({
398398
imports: [CdkTableModule, CdkPopoverEditModule, CommonModule, FormsModule, BidiModule],
399399
declarations: [componentClass],
400-
}).compileComponents();
400+
});
401401
fixture = TestBed.createComponent<BaseTestComponent>(componentClass);
402402
component = fixture.componentInstance;
403403
fixture.detectChanges();

src/cdk-experimental/scrolling/virtual-scroll-viewport.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('CdkVirtualScrollViewport', () => {
1212
beforeEach(waitForAsync(() => {
1313
TestBed.configureTestingModule({
1414
imports: [ScrollingModule, ExperimentalScrollingModule, AutoSizeVirtualScroll],
15-
}).compileComponents();
15+
});
1616
}));
1717

1818
beforeEach(() => {

src/cdk-experimental/selection/selection.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('CdkSelection', () => {
1414
beforeEach(waitForAsync(() => {
1515
TestBed.configureTestingModule({
1616
imports: [CdkSelectionModule, ListWithMultiSelection],
17-
}).compileComponents();
17+
});
1818
}));
1919

2020
beforeEach(() => {
@@ -240,7 +240,7 @@ describe('CdkSelection with multiple = false', () => {
240240
beforeEach(waitForAsync(() => {
241241
TestBed.configureTestingModule({
242242
imports: [CdkSelectionModule, ListWithSingleSelection],
243-
}).compileComponents();
243+
});
244244
}));
245245

246246
beforeEach(() => {
@@ -305,7 +305,7 @@ describe('cdkSelectionColumn', () => {
305305
beforeEach(waitForAsync(() => {
306306
TestBed.configureTestingModule({
307307
imports: [CdkSelectionModule, CdkTableModule, MultiSelectTableWithSelectionColumn],
308-
}).compileComponents();
308+
});
309309
}));
310310

311311
beforeEach(() => {
@@ -399,7 +399,7 @@ describe('cdkSelectionColumn with multiple = false', () => {
399399
beforeEach(waitForAsync(() => {
400400
TestBed.configureTestingModule({
401401
imports: [CdkSelectionModule, CdkTableModule, SingleSelectTableWithSelectionColumn],
402-
}).compileComponents();
402+
});
403403
}));
404404

405405
beforeEach(() => {

src/cdk-experimental/table-scroll-container/table-scroll-container.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('CdkTableScrollContainer', () => {
2424
): ComponentFixture<T> {
2525
TestBed.configureTestingModule({
2626
imports: [CdkTableModule, CdkTableScrollContainerModule, componentType, ...declarations],
27-
}).compileComponents();
27+
});
2828

2929
return TestBed.createComponent<T>(componentType);
3030
}

src/cdk/a11y/aria-describer/aria-describer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('AriaDescriber', () => {
1212
TestBed.configureTestingModule({
1313
imports: [A11yModule, TestApp],
1414
providers: [AriaDescriber, ...providers],
15-
}).compileComponents();
15+
});
1616

1717
fixture = TestBed.createComponent(TestApp);
1818
component = fixture.componentInstance;

src/cdk/a11y/focus-monitor/focus-monitor.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('FocusMonitor', () => {
5959
},
6060
},
6161
],
62-
}).compileComponents();
62+
});
6363
});
6464

6565
beforeEach(inject([FocusMonitor], (fm: FocusMonitor) => {
@@ -478,7 +478,7 @@ describe('FocusMonitor with "eventual" detection', () => {
478478
},
479479
},
480480
],
481-
}).compileComponents();
481+
});
482482
});
483483

484484
beforeEach(inject([FocusMonitor], (fm: FocusMonitor) => {
@@ -515,7 +515,7 @@ describe('cdkMonitorFocus', () => {
515515
FocusMonitorOnCommentNode,
516516
ExportedFocusMonitor,
517517
],
518-
}).compileComponents();
518+
});
519519
});
520520

521521
describe('button with cdkMonitorElementFocus', () => {
@@ -827,7 +827,7 @@ describe('FocusMonitor observable stream', () => {
827827
TestBed.configureTestingModule({
828828
imports: [A11yModule, PlainButton],
829829
providers: [{provide: Platform, useValue: fakePlatform}],
830-
}).compileComponents();
830+
});
831831
});
832832

833833
beforeEach(inject([FocusMonitor], (fm: FocusMonitor) => {
@@ -864,7 +864,7 @@ describe('FocusMonitor input label detection', () => {
864864
beforeEach(() => {
865865
TestBed.configureTestingModule({
866866
imports: [A11yModule, CheckboxWithLabel],
867-
}).compileComponents();
867+
});
868868
});
869869

870870
beforeEach(inject([FocusMonitor], (fm: FocusMonitor) => {

src/cdk/a11y/focus-monitor/focus-monitor.zone.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('FocusMonitor observable stream Zone.js integration', () => {
1616
TestBed.configureTestingModule({
1717
imports: [A11yModule, PlainButton],
1818
providers: [{provide: Platform, useValue: fakePlatform}, provideZoneChangeDetection()],
19-
}).compileComponents();
19+
});
2020
});
2121

2222
beforeEach(inject([FocusMonitor], (fm: FocusMonitor) => {

src/cdk/a11y/focus-trap/configurable-focus-trap.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function createComponent<T>(
9595
TestBed.configureTestingModule({
9696
imports: [A11yModule, componentType],
9797
providers: providers,
98-
}).compileComponents();
98+
});
9999

100100
return TestBed.createComponent<T>(componentType);
101101
}

src/cdk/a11y/focus-trap/event-listener-inert-strategy.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function createComponent<T>(
6464
TestBed.configureTestingModule({
6565
imports: [A11yModule, componentType],
6666
providers: providers,
67-
}).compileComponents();
67+
});
6868

6969
return TestBed.createComponent<T>(componentType);
7070
}

0 commit comments

Comments
 (0)