Skip to content

Commit fc114e2

Browse files
wKozasumitarora
authored andcommitted
feat(@angular/cli): add async method in Jasmine Tests blueprints (angular#4775)
1 parent 514d892 commit fc114e2

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

packages/@angular/cli/blueprints/ng2/files/__path__/app/app.component.spec.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ import { RouterTestingModule } from '@angular/router/testing';<% } %>
33
import { AppComponent } from './app.component';
44

55
describe('AppComponent', () => {
6-
beforeEach(() => {
6+
beforeEach(async(() => {
77
TestBed.configureTestingModule({<% if (routing) { %>
88
imports: [
99
RouterTestingModule
1010
],<% } %>
1111
declarations: [
1212
AppComponent
1313
],
14-
});
15-
TestBed.compileComponents();
16-
});
14+
}).compileComponents();
15+
}));
1716

1817
it('should create the app', async(() => {
1918
const fixture = TestBed.createComponent(AppComponent);

tests/e2e/tests/build/assets.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,16 @@ export default function () {
7777
import { AppComponent } from './app.component';
7878
7979
describe('AppComponent', () => {
80-
beforeEach(() => {
80+
beforeEach(async(() => {
8181
TestBed.configureTestingModule({
8282
imports: [
8383
HttpModule
8484
],
8585
declarations: [
8686
AppComponent
87-
],
88-
});
89-
TestBed.compileComponents();
90-
});
87+
]
88+
}).compileComponents();
89+
}));
9190
9291
it('should create the app', async(() => {
9392
const fixture = TestBed.createComponent(AppComponent);

tests/e2e/tests/test/test-scripts.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ export default function () {
2929
import { AppComponent } from './app.component';
3030
3131
describe('AppComponent', () => {
32-
beforeEach(() => {
33-
TestBed.configureTestingModule({ declarations: [ AppComponent ] });
34-
TestBed.compileComponents();
35-
});
32+
beforeEach(async(() => {
33+
TestBed.configureTestingModule({
34+
declarations: [ AppComponent ]
35+
}).compileComponents();
36+
}));
3637
3738
it('should have access to string-script.js', async(() => {
3839
let app = TestBed.createComponent(AppComponent).debugElement.componentInstance;

0 commit comments

Comments
 (0)