Skip to content

Commit d078eef

Browse files
committed
fix(material/schematics): remove waitForAsync from generated tests
Updates the tests generated by `ng generate` not to output `waitForAsync` anymore. (cherry picked from commit 8239d04)
1 parent 7b32786 commit d078eef

6 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎src/cdk/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { <% if(!standalone) { %>waitForAsync, <% } %>ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
22
import { DragDropModule } from '@angular/cdk/drag-drop';<% } %>
33
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
44

55
describe('<%= classify(name) %>Component', () => {
66
let component: <%= classify(name) %>Component;
77
let fixture: ComponentFixture<<%= classify(name) %>Component>;<% if(!standalone) { %>
88

9-
beforeEach(waitForAsync(() => {
9+
beforeEach(() => {
1010
TestBed.configureTestingModule({
1111
declarations: [<%= classify(name) %>Component],
1212
imports: [DragDropModule]
1313
});
14-
}));<% } %>
14+
});<% } %>
1515

1616
beforeEach(() => {
1717
fixture = TestBed.createComponent(<%= classify(name) %>Component);

‎src/material/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
22
import { ReactiveFormsModule } from '@angular/forms';
33
import { MatButtonModule } from '@angular/material/button';
44
import { MatCardModule } from '@angular/material/card';
@@ -12,7 +12,7 @@ describe('<%= classify(name) %>Component', () => {
1212
let component: <%= classify(name) %>Component;
1313
let fixture: ComponentFixture<<%= classify(name) %>Component>;<% if(!standalone) { %>
1414

15-
beforeEach(waitForAsync(() => {
15+
beforeEach(() => {
1616
TestBed.configureTestingModule({
1717
declarations: [<%= classify(name) %>Component],
1818
imports: [
@@ -24,7 +24,7 @@ describe('<%= classify(name) %>Component', () => {
2424
MatSelectModule,
2525
]
2626
});
27-
}));<% } %>
27+
});<% } %>
2828

2929
beforeEach(() => {
3030
fixture = TestBed.createComponent(<%= classify(name) %>Component);

‎src/material/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
22
import { MatButtonModule } from '@angular/material/button';
33
import { MatCardModule } from '@angular/material/card';
44
import { MatGridListModule } from '@angular/material/grid-list';
@@ -11,7 +11,7 @@ describe('<%= classify(name) %>Component', () => {
1111
let component: <%= classify(name) %>Component;
1212
let fixture: ComponentFixture<<%= classify(name) %>Component>;<% if(!standalone) { %>
1313

14-
beforeEach(waitForAsync(() => {
14+
beforeEach(() => {
1515
TestBed.configureTestingModule({
1616
declarations: [<%= classify(name) %>Component],
1717
imports: [
@@ -22,7 +22,7 @@ describe('<%= classify(name) %>Component', () => {
2222
MatMenuModule,
2323
]
2424
});
25-
}));<% } %>
25+
});<% } %>
2626

2727
beforeEach(() => {
2828
fixture = TestBed.createComponent(<%= classify(name) %>Component);

‎src/material/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
22
import { MatButtonModule } from '@angular/material/button';
33
import { MatIconModule } from '@angular/material/icon';
44
import { MatListModule } from '@angular/material/list';
@@ -11,7 +11,7 @@ describe('<%= classify(name) %>Component', () => {
1111
let component: <%= classify(name) %>Component;
1212
let fixture: ComponentFixture<<%= classify(name) %>Component>;<% if(!standalone) { %>
1313

14-
beforeEach(waitForAsync(() => {
14+
beforeEach(() => {
1515
TestBed.configureTestingModule({
1616
declarations: [<%= classify(name) %>Component],
1717
imports: [
@@ -22,7 +22,7 @@ describe('<%= classify(name) %>Component', () => {
2222
MatToolbarModule,
2323
]
2424
});
25-
}));<% } %>
25+
});<% } %>
2626

2727
beforeEach(() => {
2828
fixture = TestBed.createComponent(<%= classify(name) %>Component);

‎src/material/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
22
import { MatPaginatorModule } from '@angular/material/paginator';
33
import { MatSortModule } from '@angular/material/sort';
44
import { MatTableModule } from '@angular/material/table';<% } %>
@@ -9,7 +9,7 @@ describe('<%= classify(name) %>Component', () => {
99
let component: <%= classify(name) %>Component;
1010
let fixture: ComponentFixture<<%= classify(name) %>Component>;<% if(!standalone) { %>
1111

12-
beforeEach(waitForAsync(() => {
12+
beforeEach(() => {
1313
TestBed.configureTestingModule({
1414
declarations: [<%= classify(name) %>Component],
1515
imports: [
@@ -18,7 +18,7 @@ describe('<%= classify(name) %>Component', () => {
1818
MatTableModule,
1919
]
2020
});
21-
}));<% } %>
21+
});<% } %>
2222

2323
beforeEach(() => {
2424
fixture = TestBed.createComponent(<%= classify(name) %>Component);

‎src/material/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { <% if(!standalone) { %>waitForAsync, <% } %>ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';<% if(!standalone) { %>
22
import { MatButtonModule } from '@angular/material/button';
33
import { MatIconModule } from '@angular/material/icon';
44
import { MatTreeModule } from '@angular/material/tree';<% } %>
@@ -9,7 +9,7 @@ describe('<%= classify(name) %>Component', () => {
99
let component: <%= classify(name) %>Component;
1010
let fixture: ComponentFixture<<%= classify(name) %>Component>;<% if(!standalone) { %>
1111

12-
beforeEach(waitForAsync(() => {
12+
beforeEach(() => {
1313
TestBed.configureTestingModule({
1414
declarations: [<%= classify(name) %>Component],
1515
imports: [
@@ -18,7 +18,7 @@ describe('<%= classify(name) %>Component', () => {
1818
MatTreeModule,
1919
]
2020
});
21-
}));<% } %>
21+
});<% } %>
2222

2323
beforeEach(() => {
2424
fixture = TestBed.createComponent(<%= classify(name) %>Component);

0 commit comments

Comments
 (0)