Skip to content

Commit e562579

Browse files
Broccofilipesilva
authored andcommitted
chore: update component spec file to use TestBed (angular#2674)
1 parent 2225027 commit e562579

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed
Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
/* tslint:disable:no-unused-variable */
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
import { By } from '@angular/platform-browser';
4+
import { DebugElement } from '@angular/core';
25

3-
import { TestBed, async } from '@angular/core/testing';
46
import { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component';
57

6-
describe('Component: <%= classifiedModuleName %>', () => {
7-
it('should create an instance', () => {
8-
let component = new <%= classifiedModuleName %>Component();
8+
describe('<%= classifiedModuleName %>Component', () => {
9+
let component: <%= classifiedModuleName %>Component;
10+
let fixture: ComponentFixture<<%= classifiedModuleName %>Component>;
11+
12+
beforeEach(async(() => {
13+
TestBed.configureTestingModule({
14+
declarations: [ <%= classifiedModuleName %>Component ]
15+
})
16+
.compileComponents();
17+
}));
18+
19+
beforeEach(() => {
20+
fixture = TestBed.createComponent(<%= classifiedModuleName %>Component);
21+
component = fixture.componentInstance;
22+
fixture.detectChanges();
23+
});
24+
25+
it('should create', () => {
926
expect(component).toBeTruthy();
1027
});
1128
});

0 commit comments

Comments
 (0)