|
1 | 1 | import { TestBed, async } from '@angular/core/testing';
|
2 | 2 | import { AppComponent } from './app.component';
|
3 | 3 | describe('AppComponent', () => {
|
4 |
| - beforeEach(async(() => { |
5 |
| - TestBed.configureTestingModule({ |
6 |
| - declarations: [ |
7 |
| - AppComponent |
8 |
| - ], |
9 |
| - }).compileComponents(); |
10 |
| - })); |
11 |
| - it('should create the app', async(() => { |
12 |
| - const fixture = TestBed.createComponent(AppComponent); |
13 |
| - const app = fixture.debugElement.componentInstance; |
14 |
| - expect(app).toBeTruthy(); |
15 |
| - })); |
16 |
| - it(`should have as title 'app'`, async(() => { |
17 |
| - const fixture = TestBed.createComponent(AppComponent); |
18 |
| - const app = fixture.debugElement.componentInstance; |
19 |
| - expect(app.title).toEqual('app'); |
20 |
| - })); |
21 |
| - it('should render title in a h1 tag', async(() => { |
22 |
| - const fixture = TestBed.createComponent(AppComponent); |
23 |
| - fixture.detectChanges(); |
24 |
| - const compiled = fixture.debugElement.nativeElement; |
25 |
| - expect(compiled.querySelector('h1').textContent).toContain('Welcome to angularjs-to-angular!'); |
26 |
| - })); |
| 4 | + beforeEach( |
| 5 | + async(() => { |
| 6 | + TestBed.configureTestingModule({ |
| 7 | + declarations: [AppComponent] |
| 8 | + }).compileComponents(); |
| 9 | + }) |
| 10 | + ); |
| 11 | + it( |
| 12 | + 'should create the app', |
| 13 | + async(() => { |
| 14 | + const fixture = TestBed.createComponent(AppComponent); |
| 15 | + const app = fixture.debugElement.componentInstance; |
| 16 | + expect(app).toBeTruthy(); |
| 17 | + }) |
| 18 | + ); |
| 19 | + it( |
| 20 | + `should have as title 'app'`, |
| 21 | + async(() => { |
| 22 | + const fixture = TestBed.createComponent(AppComponent); |
| 23 | + const app = fixture.debugElement.componentInstance; |
| 24 | + expect(app.title).toEqual('app'); |
| 25 | + }) |
| 26 | + ); |
| 27 | + it( |
| 28 | + 'should render title in a h1 tag', |
| 29 | + async(() => { |
| 30 | + const fixture = TestBed.createComponent(AppComponent); |
| 31 | + fixture.detectChanges(); |
| 32 | + const compiled = fixture.debugElement.nativeElement; |
| 33 | + expect(compiled.querySelector('h1').textContent).toContain( |
| 34 | + 'Welcome to angularjs-to-angular!' |
| 35 | + ); |
| 36 | + }) |
| 37 | + ); |
27 | 38 | });
|
0 commit comments