Skip to content

Commit 623b0c9

Browse files
authored
docs(multiple): remove unecessary async/await from docs (#25850)
We don't need to `await` the `TestBed.compileComponents` call. It can only be async if the tests have external templates or stylesheets which we don't use in our tests.
1 parent 52baa14 commit 623b0c9

File tree

34 files changed

+70
-70
lines changed

34 files changed

+70
-70
lines changed

src/components-examples/material/autocomplete/autocomplete-harness/autocomplete-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('AutocompleteHarnessExample', () => {
1010
let fixture: ComponentFixture<AutocompleteHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatAutocompleteModule, NoopAnimationsModule],
1616
declarations: [AutocompleteHarnessExample],
1717
}).compileComponents();

src/components-examples/material/badge/badge-harness/badge-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('BadgeHarnessExample', () => {
99
let fixture: ComponentFixture<BadgeHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatBadgeModule],
1515
declarations: [BadgeHarnessExample],
1616
}).compileComponents();

src/components-examples/material/bottom-sheet/bottom-sheet-harness/bottom-sheet-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('BottomSheetHarnessExample', () => {
1010
let fixture: ComponentFixture<BottomSheetHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatBottomSheetModule, NoopAnimationsModule],
1616
declarations: [BottomSheetHarnessExample],
1717
}).compileComponents();

src/components-examples/material/button-toggle/button-toggle-harness/button-toggle-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('ButtonToggleHarnessExample', () => {
99
let fixture: ComponentFixture<ButtonToggleHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatButtonToggleModule],
1515
declarations: [ButtonToggleHarnessExample],
1616
}).compileComponents();

src/components-examples/material/button/button-harness/button-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('ButtonHarnessExample', () => {
99
let fixture: ComponentFixture<ButtonHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatButtonModule],
1515
declarations: [ButtonHarnessExample],
1616
}).compileComponents();

src/components-examples/material/card/card-harness/card-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('CardHarnessExample', () => {
1010
let fixture: ComponentFixture<CardHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatCardModule],
1616
declarations: [CardHarnessExample],
1717
}).compileComponents();

src/components-examples/material/checkbox/checkbox-harness/checkbox-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('CheckboxHarnessExample', () => {
1010
let fixture: ComponentFixture<CheckboxHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatCheckboxModule, ReactiveFormsModule],
1616
declarations: [CheckboxHarnessExample],
1717
}).compileComponents();

src/components-examples/material/chips/chips-harness/chips-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('ChipsHarnessExample', () => {
1010
let fixture: ComponentFixture<ChipsHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatChipsModule, NoopAnimationsModule],
1616
declarations: [ChipsHarnessExample],
1717
}).compileComponents();

src/components-examples/material/datepicker/datepicker-harness/datepicker-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ describe('DatepickerHarnessExample', () => {
1212
let fixture: ComponentFixture<DatepickerHarnessExample>;
1313
let loader: HarnessLoader;
1414

15-
beforeEach(async () => {
16-
await TestBed.configureTestingModule({
15+
beforeEach(() => {
16+
TestBed.configureTestingModule({
1717
imports: [MatDatepickerModule, NoopAnimationsModule, MatNativeDateModule, FormsModule],
1818
declarations: [DatepickerHarnessExample],
1919
}).compileComponents();

src/components-examples/material/dialog/dialog-harness/dialog-harness-example.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
1+
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
33
import {MatDialogHarness} from '@angular/material/dialog/testing';
44
import {HarnessLoader} from '@angular/cdk/testing';
@@ -10,15 +10,15 @@ describe('DialogHarnessExample', () => {
1010
let fixture: ComponentFixture<DialogHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(waitForAsync(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatDialogModule, NoopAnimationsModule],
1616
declarations: [DialogHarnessExample],
1717
}).compileComponents();
1818
fixture = TestBed.createComponent(DialogHarnessExample);
1919
fixture.detectChanges();
2020
loader = TestbedHarnessEnvironment.documentRootLoader(fixture);
21-
}));
21+
});
2222

2323
it('should load harness for dialog', async () => {
2424
fixture.componentInstance.open();

src/components-examples/material/divider/divider-harness/divider-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('DividerHarnessExample', () => {
99
let fixture: ComponentFixture<DividerHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatDividerModule],
1515
declarations: [DividerHarnessExample],
1616
}).compileComponents();

src/components-examples/material/expansion/expansion-harness/expansion-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('ExpansionHarnessExample', () => {
1010
let fixture: ComponentFixture<ExpansionHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatExpansionModule, NoopAnimationsModule],
1616
declarations: [ExpansionHarnessExample],
1717
}).compileComponents();

src/components-examples/material/form-field/form-field-harness/form-field-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ describe('FormFieldHarnessExample', () => {
1313
let fixture: ComponentFixture<FormFieldHarnessExample>;
1414
let loader: HarnessLoader;
1515

16-
beforeEach(async () => {
17-
await TestBed.configureTestingModule({
16+
beforeEach(() => {
17+
TestBed.configureTestingModule({
1818
imports: [MatFormFieldModule, MatInputModule, ReactiveFormsModule, NoopAnimationsModule],
1919
declarations: [FormFieldHarnessExample],
2020
}).compileComponents();

src/components-examples/material/grid-list/grid-list-harness/grid-list-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('GridListHarnessExample', () => {
99
let fixture: ComponentFixture<GridListHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatGridListModule],
1515
declarations: [GridListHarnessExample],
1616
}).compileComponents();

src/components-examples/material/icon/icon-harness/icon-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('IconHarnessExample', () => {
1010
let fixture: ComponentFixture<IconHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatIconModule],
1616
declarations: [IconHarnessExample],
1717
}).compileComponents();

src/components-examples/material/input/input-harness/input-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ describe('InputHarnessExample', () => {
1111
let fixture: ComponentFixture<InputHarnessExample>;
1212
let loader: HarnessLoader;
1313

14-
beforeEach(async () => {
15-
await TestBed.configureTestingModule({
14+
beforeEach(() => {
15+
TestBed.configureTestingModule({
1616
imports: [MatInputModule, NoopAnimationsModule, ReactiveFormsModule],
1717
declarations: [InputHarnessExample],
1818
}).compileComponents();

src/components-examples/material/list/list-harness/list-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('ListHarnessExample', () => {
99
let fixture: ComponentFixture<ListHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatListModule],
1515
declarations: [ListHarnessExample],
1616
}).compileComponents();

src/components-examples/material/menu/menu-harness/menu-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('MenuHarnessExample', () => {
1010
let fixture: ComponentFixture<MenuHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatMenuModule, NoopAnimationsModule],
1616
declarations: [MenuHarnessExample],
1717
}).compileComponents();

src/components-examples/material/paginator/paginator-harness/paginator-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ describe('PaginatorHarnessExample', () => {
1111
let loader: HarnessLoader;
1212
let instance: PaginatorHarnessExample;
1313

14-
beforeEach(async () => {
15-
await TestBed.configureTestingModule({
14+
beforeEach(() => {
15+
TestBed.configureTestingModule({
1616
imports: [MatPaginatorModule, NoopAnimationsModule],
1717
declarations: [PaginatorHarnessExample],
1818
}).compileComponents();

src/components-examples/material/progress-bar/progress-bar-harness/progress-bar-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('ProgressBarHarnessExample', () => {
99
let fixture: ComponentFixture<ProgressBarHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatProgressBarModule],
1515
declarations: [ProgressBarHarnessExample],
1616
}).compileComponents();

src/components-examples/material/progress-spinner/progress-spinner-harness/progress-spinner-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('ProgressSpinnerHarnessExample', () => {
99
let fixture: ComponentFixture<ProgressSpinnerHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatProgressSpinnerModule],
1515
declarations: [ProgressSpinnerHarnessExample],
1616
}).compileComponents();

src/components-examples/material/radio/radio-harness/radio-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('RadioHarnessExample', () => {
1010
let fixture: ComponentFixture<RadioHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatRadioModule, ReactiveFormsModule],
1616
declarations: [RadioHarnessExample],
1717
}).compileComponents();

src/components-examples/material/select/select-harness/select-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('SelectHarnessExample', () => {
1010
let fixture: ComponentFixture<SelectHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatSelectModule, NoopAnimationsModule],
1616
declarations: [SelectHarnessExample],
1717
}).compileComponents();

src/components-examples/material/sidenav/sidenav-harness/sidenav-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ describe('SidenavHarnessExample', () => {
1414
let fixture: ComponentFixture<SidenavHarnessExample>;
1515
let loader: HarnessLoader;
1616

17-
beforeEach(async () => {
18-
await TestBed.configureTestingModule({
17+
beforeEach(() => {
18+
TestBed.configureTestingModule({
1919
imports: [MatSidenavModule, NoopAnimationsModule],
2020
declarations: [SidenavHarnessExample],
2121
}).compileComponents();

src/components-examples/material/slide-toggle/slide-toggle-harness/slide-toggle-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('SlideToggleHarnessExample', () => {
1010
let fixture: ComponentFixture<SlideToggleHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatSlideToggleModule, ReactiveFormsModule],
1616
declarations: [SlideToggleHarnessExample],
1717
}).compileComponents();

src/components-examples/material/slider/slider-harness/slider-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('SliderHarnessExample', () => {
99
let fixture: ComponentFixture<SliderHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatSliderModule],
1515
declarations: [SliderHarnessExample],
1616
}).compileComponents();

src/components-examples/material/snack-bar/snack-bar-harness/snack-bar-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('SnackBarHarnessExample', () => {
1010
let fixture: ComponentFixture<SnackBarHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatSnackBarModule, NoopAnimationsModule],
1616
declarations: [SnackBarHarnessExample],
1717
}).compileComponents();

src/components-examples/material/sort/sort-harness/sort-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('SortHarnessExample', () => {
1010
let fixture: ComponentFixture<SortHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatSortModule, NoopAnimationsModule],
1616
declarations: [SortHarnessExample],
1717
}).compileComponents();

src/components-examples/material/stepper/stepper-harness/stepper-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ describe('StepperHarnessExample', () => {
1111
let fixture: ComponentFixture<StepperHarnessExample>;
1212
let loader: HarnessLoader;
1313

14-
beforeEach(async () => {
15-
await TestBed.configureTestingModule({
14+
beforeEach(() => {
15+
TestBed.configureTestingModule({
1616
imports: [MatStepperModule, NoopAnimationsModule, ReactiveFormsModule],
1717
declarations: [StepperHarnessExample],
1818
}).compileComponents();

src/components-examples/material/table/table-harness/table-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('TableHarnessExample', () => {
99
let fixture: ComponentFixture<TableHarnessExample>;
1010
let loader: HarnessLoader;
1111

12-
beforeEach(async () => {
13-
await TestBed.configureTestingModule({
12+
beforeEach(() => {
13+
TestBed.configureTestingModule({
1414
imports: [MatTableModule],
1515
declarations: [TableHarnessExample],
1616
}).compileComponents();

src/components-examples/material/tabs/tab-group-harness/tab-group-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('TabGroupHarnessExample', () => {
1010
let fixture: ComponentFixture<TabGroupHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatTabsModule, NoopAnimationsModule],
1616
declarations: [TabGroupHarnessExample],
1717
}).compileComponents();

src/components-examples/material/toolbar/toolbar-harness/toolbar-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('ToolbarHarnessExample', () => {
1010
let fixture: ComponentFixture<ToolbarHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatToolbarModule, MatIconModule],
1616
declarations: [ToolbarHarnessExample],
1717
}).compileComponents();

src/components-examples/material/tooltip/tooltip-harness/tooltip-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('TooltipHarnessExample', () => {
1010
let fixture: ComponentFixture<TooltipHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatTooltipModule, NoopAnimationsModule],
1616
declarations: [TooltipHarnessExample],
1717
}).compileComponents();

src/components-examples/material/tree/tree-harness/tree-harness-example.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('TreeHarnessExample', () => {
1010
let fixture: ComponentFixture<TreeHarnessExample>;
1111
let loader: HarnessLoader;
1212

13-
beforeEach(async () => {
14-
await TestBed.configureTestingModule({
13+
beforeEach(() => {
14+
TestBed.configureTestingModule({
1515
imports: [MatTreeModule, MatIconModule],
1616
declarations: [TreeHarnessExample],
1717
}).compileComponents();

0 commit comments

Comments
 (0)