diff --git a/packages/angular-cli/blueprints/class/files/__path__/__name__.spec.ts b/packages/angular-cli/blueprints/class/files/__path__/__name__.spec.ts index 93187c2ddc3e..86dd09076edd 100644 --- a/packages/angular-cli/blueprints/class/files/__path__/__name__.spec.ts +++ b/packages/angular-cli/blueprints/class/files/__path__/__name__.spec.ts @@ -1,6 +1,3 @@ -/* tslint:disable:no-unused-variable */ - -import { addProviders, async, inject } from '@angular/core/testing'; import {<%= classifiedModuleName %>} from './<%= fileName %>'; describe('<%= classifiedModuleName %>', () => { diff --git a/tests/e2e/tests/generate/class.ts b/tests/e2e/tests/generate/class.ts new file mode 100644 index 000000000000..b828b40e61d8 --- /dev/null +++ b/tests/e2e/tests/generate/class.ts @@ -0,0 +1,17 @@ +import {join} from 'path'; +import {ng} from '../../utils/process'; +import {expectFileToExist} from '../../utils/fs'; + + +export default function() { + // Create the pipe in the same directory. + const classDir = join('src', 'app'); + + return ng('generate', 'class', 'test-class') + .then(() => expectFileToExist(classDir)) + .then(() => expectFileToExist(join(classDir, 'test-class.ts'))) + .then(() => expectFileToExist(join(classDir, 'test-class.spec.ts'))) + + // Try to run the unit tests. + .then(() => ng('test', '--watch=false')); +}