diff --git a/packages/angular-cli/blueprints/component/files/__path__/__name__.component.spec.ts b/packages/angular-cli/blueprints/component/files/__path__/__name__.component.spec.ts index e7ed84fac3d2..dd1fec0b6e9e 100644 --- a/packages/angular-cli/blueprints/component/files/__path__/__name__.component.spec.ts +++ b/packages/angular-cli/blueprints/component/files/__path__/__name__.component.spec.ts @@ -1,11 +1,28 @@ /* tslint:disable:no-unused-variable */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; +import { DebugElement } from '@angular/core'; -import { TestBed, async } from '@angular/core/testing'; import { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component'; -describe('Component: <%= classifiedModuleName %>', () => { - it('should create an instance', () => { - let component = new <%= classifiedModuleName %>Component(); +describe('<%= classifiedModuleName %>Component', () => { + let component: <%= classifiedModuleName %>Component; + let fixture: ComponentFixture<<%= classifiedModuleName %>Component>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ <%= classifiedModuleName %>Component ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(<%= classifiedModuleName %>Component); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { expect(component).toBeTruthy(); }); });