Skip to content

Commit 9d4efb5

Browse files
Danny Bluefilipesilva
Danny Blue
authored andcommitted
bugfix(generate): removes bad imports when generating a class
Fix #2288 Close #2492
1 parent c2f4b37 commit 9d4efb5

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

packages/angular-cli/blueprints/class/files/__path__/__name__.spec.ts

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/* tslint:disable:no-unused-variable */
2-
3-
import { addProviders, async, inject } from '@angular/core/testing';
41
import {<%= classifiedModuleName %>} from './<%= fileName %>';
52

63
describe('<%= classifiedModuleName %>', () => {

tests/e2e/tests/generate/class.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {join} from 'path';
2+
import {ng} from '../../utils/process';
3+
import {expectFileToExist} from '../../utils/fs';
4+
5+
6+
export default function() {
7+
const classDir = join('src', 'app');
8+
9+
return ng('generate', 'class', 'test-class', '--spec')
10+
.then(() => expectFileToExist(classDir))
11+
.then(() => expectFileToExist(join(classDir, 'test-class.ts')))
12+
.then(() => expectFileToExist(join(classDir, 'test-class.spec.ts')))
13+
14+
// Try to run the unit tests.
15+
.then(() => ng('test', '--watch=false'));
16+
}

0 commit comments

Comments
 (0)