feat(@angular/cli): add async method in Jasmine Tests blueprints (#4775)

This commit is contained in:
William KOZA 2017-02-21 23:29:11 +01:00 committed by Hans
parent d1e13ace0b
commit c792c9f8b8
3 changed files with 12 additions and 13 deletions

View File

@ -3,7 +3,7 @@ import { RouterTestingModule } from '@angular/router/testing';<% } %>
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(() => {
beforeEach(async(() => {
TestBed.configureTestingModule({<% if (routing) { %>
imports: [
RouterTestingModule
@ -11,9 +11,8 @@ describe('AppComponent', () => {
declarations: [
AppComponent
],
});
TestBed.compileComponents();
});
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);

View File

@ -77,17 +77,16 @@ export default function () {
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(() => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
HttpModule
],
declarations: [
AppComponent
],
});
TestBed.compileComponents();
});
]
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);

View File

@ -29,10 +29,11 @@ export default function () {
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({ declarations: [ AppComponent ] });
TestBed.compileComponents();
});
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AppComponent ]
}).compileComponents();
}));
it('should have access to string-script.js', async(() => {
let app = TestBed.createComponent(AppComponent).debugElement.componentInstance;