mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-21 22:34:21 +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';
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
beforeEach(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({<% if (routing) { %>
|
TestBed.configureTestingModule({<% if (routing) { %>
|
||||||
imports: [
|
imports: [
|
||||||
RouterTestingModule
|
RouterTestingModule
|
||||||
@ -11,9 +11,8 @@ describe('AppComponent', () => {
|
|||||||
declarations: [
|
declarations: [
|
||||||
AppComponent
|
AppComponent
|
||||||
],
|
],
|
||||||
});
|
}).compileComponents();
|
||||||
TestBed.compileComponents();
|
}));
|
||||||
});
|
|
||||||
|
|
||||||
it('should create the app', async(() => {
|
it('should create the app', async(() => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
@ -77,17 +77,16 @@ export default function () {
|
|||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
beforeEach(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
HttpModule
|
HttpModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent
|
AppComponent
|
||||||
],
|
]
|
||||||
});
|
}).compileComponents();
|
||||||
TestBed.compileComponents();
|
}));
|
||||||
});
|
|
||||||
|
|
||||||
it('should create the app', async(() => {
|
it('should create the app', async(() => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
@ -29,10 +29,11 @@ export default function () {
|
|||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
beforeEach(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({ declarations: [ AppComponent ] });
|
TestBed.configureTestingModule({
|
||||||
TestBed.compileComponents();
|
declarations: [ AppComponent ]
|
||||||
});
|
}).compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
it('should have access to string-script.js', async(() => {
|
it('should have access to string-script.js', async(() => {
|
||||||
let app = TestBed.createComponent(AppComponent).debugElement.componentInstance;
|
let app = TestBed.createComponent(AppComponent).debugElement.componentInstance;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user