diff --git a/addon/ng2/blueprints/class/files/__path__/__name__.spec.ts b/addon/ng2/blueprints/class/files/__path__/__name__.spec.ts index 1ae0adbbe88d..d8d67bed52a0 100644 --- a/addon/ng2/blueprints/class/files/__path__/__name__.spec.ts +++ b/addon/ng2/blueprints/class/files/__path__/__name__.spec.ts @@ -1,9 +1,10 @@ +/* tslint:disable:no-unused-variable */ + import { - describe, - ddescribe, - expect, - iit, - it + beforeEach, beforeEachProviders, + describe, ddescribe, xdescribe, + expect, it, iit, xit, + async, inject } from '@angular/core/testing'; import {<%= classifiedModuleName %>} from './<%= fileName %>'; diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts b/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts index 24d58e75d3f2..069f21013629 100644 --- a/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts +++ b/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts @@ -1,46 +1,20 @@ +/* tslint:disable:no-unused-variable */ + +import { By } from '@angular/platform-browser'; +import { DebugElement } from '@angular/core'; + import { - beforeEach, - beforeEachProviders, - describe, - expect, - it, - inject + beforeEach, beforeEachProviders, + describe, ddescribe, xdescribe, + expect, it, iit, xit, + async, inject } from '@angular/core/testing'; -import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing'; -import { Component } from '@angular/core'; -import { By } from '@angular/platform-browser'; + import { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component'; describe('Component: <%= classifiedModuleName %>', () => { - let builder: TestComponentBuilder; - - beforeEachProviders(() => [<%= classifiedModuleName %>Component]); - beforeEach(inject([TestComponentBuilder], function (tcb: TestComponentBuilder) { - builder = tcb; - })); - - it('should inject the component', inject([<%= classifiedModuleName %>Component], - (component: <%= classifiedModuleName %>Component) => { + it('should create an instance', () => { + let component = new <%= classifiedModuleName %>Component(); expect(component).toBeTruthy(); - })); - - it('should create the component', inject([], () => { - return builder.createAsync(<%= classifiedModuleName %>ComponentTestController) - .then((fixture: ComponentFixture) => { - let query = fixture.debugElement.query(By.directive(<%= classifiedModuleName %>Component)); - expect(query).toBeTruthy(); - expect(query.componentInstance).toBeTruthy(); - }); - })); + }); }); - -@Component({ - selector: 'test', - template: ` - <<%= selector %>>> - `, - directives: [<%= classifiedModuleName %>Component] -}) -class <%= classifiedModuleName %>ComponentTestController { -} - diff --git a/addon/ng2/blueprints/directive/files/__path__/__name__.directive.spec.ts b/addon/ng2/blueprints/directive/files/__path__/__name__.directive.spec.ts index d46fc539725b..76efffe0cc07 100644 --- a/addon/ng2/blueprints/directive/files/__path__/__name__.directive.spec.ts +++ b/addon/ng2/blueprints/directive/files/__path__/__name__.directive.spec.ts @@ -1,29 +1,16 @@ +/* tslint:disable:no-unused-variable */ + import { - async, - beforeEachProviders, - describe, - ddescribe, - expect, - iit, - it, - inject + beforeEach, beforeEachProviders, + describe, ddescribe, xdescribe, + expect, it, iit, xit, + async, inject } from '@angular/core/testing'; -import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing'; -import { provide, Component } from '@angular/core'; import { <%= classifiedModuleName %> } from './<%= dasherizedModuleName %>.directive'; -@Component({ - selector: 'test-component', - template: `
>
` -}) -class TestComponent {} - describe('<%= classifiedModuleName %> Directive', () => { - beforeEachProviders((): any[] => []); - - it('should ...', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { - return tcb.createAsync(TestComponent).then((fixture: ComponentFixture) => { - fixture.detectChanges(); - }); - }))); + it('should create an instance', () => { + let directive = new <%= classifiedModuleName %>(); + expect(directive).toBeTruthy(); + }); }); diff --git a/addon/ng2/blueprints/ng2/files/__path__/app/app.component.spec.ts b/addon/ng2/blueprints/ng2/files/__path__/app/app.component.spec.ts index e5a8e63a4d96..cf5bdda2c920 100644 --- a/addon/ng2/blueprints/ng2/files/__path__/app/app.component.spec.ts +++ b/addon/ng2/blueprints/ng2/files/__path__/app/app.component.spec.ts @@ -1,9 +1,10 @@ +/* tslint:disable:no-unused-variable */ + import { - beforeEachProviders, - describe, - expect, - it, - inject + beforeEach, beforeEachProviders, + describe, ddescribe, xdescribe, + expect, it, iit, xit, + async, inject } from '@angular/core/testing'; import { AppComponent } from './app.component'; diff --git a/addon/ng2/blueprints/pipe/files/__path__/__name__.pipe.spec.ts b/addon/ng2/blueprints/pipe/files/__path__/__name__.pipe.spec.ts index dad56f4101ee..ae528fc71235 100644 --- a/addon/ng2/blueprints/pipe/files/__path__/__name__.pipe.spec.ts +++ b/addon/ng2/blueprints/pipe/files/__path__/__name__.pipe.spec.ts @@ -1,16 +1,16 @@ +/* tslint:disable:no-unused-variable */ + import { - beforeEachProviders, - describe, - expect, - inject, - it + beforeEach, beforeEachProviders, + describe, ddescribe, xdescribe, + expect, it, iit, xit, + async, inject } from '@angular/core/testing'; import { <%= classifiedModuleName %>Pipe } from './<%= dasherizedModuleName %>.pipe'; describe('Pipe: <%= classifiedModuleName %>', () => { - beforeEachProviders(() => [<%= classifiedModuleName%>Pipe]); - - it('should transform the input', inject([<%= classifiedModuleName %>Pipe], (pipe: <%= classifiedModuleName %>Pipe) => { - expect(pipe.transform(true)).toBe(null); - })); + it('create an instance', () => { + let pipe = new <%= classifiedModuleName %>Pipe(); + expect(pipe).toBeTruthy(); + }); }); diff --git a/addon/ng2/blueprints/service/files/__path__/__name__.service.spec.ts b/addon/ng2/blueprints/service/files/__path__/__name__.service.spec.ts index 22388d3435ec..ec145bba622d 100644 --- a/addon/ng2/blueprints/service/files/__path__/__name__.service.spec.ts +++ b/addon/ng2/blueprints/service/files/__path__/__name__.service.spec.ts @@ -1,9 +1,10 @@ +/* tslint:disable:no-unused-variable */ + import { - beforeEachProviders, - it, - describe, - expect, - inject + beforeEach, beforeEachProviders, + describe, ddescribe, xdescribe, + expect, it, iit, xit, + async, inject } from '@angular/core/testing'; import { <%= classifiedModuleName %>Service } from './<%= dasherizedModuleName %>.service';