mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-21 05:52:41 +08:00
feat(@angular/cli): add async method in Jasmine Tests blueprints (#4775)
This commit is contained in:
parent
d1e13ace0b
commit
c792c9f8b8
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user