Skip to content

Commit bfde155

Browse files
committed
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. (cherry picked from commit 623b0c9)
1 parent 4d9ae67 commit bfde155

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();

0 commit comments

Comments
 (0)