Revision 61417
Added by John Balasis over 2 years ago
app.component.spec.ts | ||
---|---|---|
1 |
import { TestBed, async } from '@angular/core/testing';
|
|
1 |
import { TestBed, waitForAsync } from '@angular/core/testing';
|
|
2 | 2 |
import { AppComponent } from './app.component'; |
3 | 3 |
describe('AppComponent', () => { |
4 |
beforeEach(async(() => {
|
|
4 |
beforeEach(waitForAsync(() => {
|
|
5 | 5 |
TestBed.configureTestingModule({ |
6 | 6 |
declarations: [ |
7 | 7 |
AppComponent |
8 | 8 |
], |
9 | 9 |
}).compileComponents(); |
10 | 10 |
})); |
11 |
it('should create the app', async(() => {
|
|
11 |
it('should create the app', waitForAsync(() => {
|
|
12 | 12 |
const fixture = TestBed.createComponent(AppComponent); |
13 | 13 |
const app = fixture.debugElement.componentInstance; |
14 | 14 |
expect(app).toBeTruthy(); |
15 | 15 |
})); |
16 |
it(`should have as title 'app'`, async(() => {
|
|
16 |
it(`should have as title 'app'`, waitForAsync(() => {
|
|
17 | 17 |
const fixture = TestBed.createComponent(AppComponent); |
18 | 18 |
const app = fixture.debugElement.componentInstance; |
19 | 19 |
expect(app.title).toEqual('app'); |
20 | 20 |
})); |
21 |
it('should render title in a h1 tag', async(() => {
|
|
21 |
it('should render title in a h1 tag', waitForAsync(() => {
|
|
22 | 22 |
const fixture = TestBed.createComponent(AppComponent); |
23 | 23 |
fixture.detectChanges(); |
24 | 24 |
const compiled = fixture.debugElement.nativeElement; |
Also available in: Unified diff
Upgrade Angular to v11