Skip to content

Commit ae476cc

Browse files
committed
test(blueprints): updated spec files for NgModule pattern
1 parent 136b4eb commit ae476cc

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
/* tslint:disable:no-unused-variable */
22

3-
import { addProviders, async, inject } from '@angular/core/testing';
3+
import { TestBed, async } from '@angular/core/testing';
4+
import { AppModule } from './app.module';
45
import { AppComponent } from './app.component';
56

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+
}));
1012

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+
});
1517

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+
});
2022
});

0 commit comments

Comments
 (0)