fix(generators): make generated tests work

This commit is contained in:
Ciro Nunes 2015-12-03 15:14:29 +00:00
parent 2c6ba3cb8f
commit 027429fae6
4 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,6 @@
/// <reference path="node_modules/angular2/manual_typings/globals-es6.d.ts"/>
// this should be remove after fixing https://github.com/angular/angular/issues/5596
import {bootstrap} from 'angular2/platform/browser';
import {<%= jsComponentName %>App} from './app/<%= htmlComponentName %>';

View File

@ -15,11 +15,11 @@ import {<%= classifiedModuleName %>} from './<%= dasherizedModuleName %>';
describe('<%= classifiedModuleName %> Pipe', () => {
beforeEachProviders(() => []);
beforeEachProviders(() => [<%= classifiedModuleName%>]);
it('should ...', inject([<%= classifiedModuleName %>], (pipe:<%= classifiedModuleName %>) => {
expect(pipe.transform(true)).toBe(false);
it('should transform the input', inject([<%= classifiedModuleName %>], (pipe:<%= classifiedModuleName %>) => {
expect(pipe.transform(true)).toBe(null);
}));
});

View File

@ -7,7 +7,7 @@ import {Pipe} from 'angular2/core';
export class <%= classifiedModuleName %> {
transform(value, args?) {
return value;
return null;
}
}

View File

@ -15,7 +15,7 @@ import {<%= classifiedModuleName %>} from './<%= dasherizedModuleName %>';
describe('<%= classifiedModuleName %> Service', () => {
beforeEachProviders(() => []);
beforeEachProviders(() => [<%= classifiedModuleName %>]);
it('should ...', inject([<%= classifiedModuleName %>], (service:<%= classifiedModuleName %>) => {