|
1 | 1 | /* tslint:disable:no-unused-variable */ |
2 | 2 |
|
3 | | -import { addProviders, async, inject } from '@angular/core/testing'; |
| 3 | +import { TestBed, async } from '@angular/core/testing'; |
| 4 | +import { AppModule } from './app.module'; |
4 | 5 | import { AppComponent } from './app.component'; |
5 | 6 |
|
6 | | -describe('App: <%= jsComponentName %>', () => { |
7 | | - beforeEach(() => { |
8 | | - addProviders([AppComponent]); |
9 | | - }); |
| 7 | +describe('App: TestProject', () => { |
| 8 | + beforeEach(async(() => { |
| 9 | + TestBed.configureTestingModule({ imports: [AppModule] }); |
| 10 | + TestBed.compileComponents(); |
| 11 | + })); |
10 | 12 |
|
11 | | - it('should create the app', |
12 | | - inject([AppComponent], (app: AppComponent) => { |
13 | | - expect(app).toBeTruthy(); |
14 | | - })); |
| 13 | + it('should create the app', () => { |
| 14 | + const compFixture = TestBed.createComponent(AppComponent); |
| 15 | + expect(compFixture).toBeTruthy(); |
| 16 | + }); |
15 | 17 |
|
16 | | - it('should have as title \'app works!\'', |
17 | | - inject([AppComponent], (app: AppComponent) => { |
18 | | - expect(app.title).toEqual('app works!'); |
19 | | - })); |
| 18 | + it('should have a title `app works!`', () => { |
| 19 | + const compFixture = TestBed.createComponent(AppComponent); |
| 20 | + expect(compFixture.componentInstance.title).toBe('app works!'); |
| 21 | + }); |
20 | 22 | }); |
0 commit comments