|
1 | 1 | import {join} from 'path';
|
2 | 2 | import {ng} from '../../../utils/process';
|
3 |
| -import {expectFileToExist, createDir} from '../../../utils/fs'; |
| 3 | +import {expectFileToExist} from '../../../utils/fs'; |
4 | 4 |
|
5 | 5 |
|
6 | 6 | export default function() {
|
7 |
| - const rootDir = join('src', 'app', 'Upper-Dir'); |
8 |
| - createDir(rootDir); |
| 7 | + const upperDirs = join('non', 'existing', 'dir'); |
| 8 | + const rootDir = join('src', 'app', upperDirs); |
| 9 | + |
9 | 10 | const componentDir = join(rootDir, 'test-component');
|
10 | 11 | const componentTwoDir = join(rootDir, 'test-component-two');
|
11 | 12 |
|
12 |
| - return ng('generate', 'component', 'Upper-Dir/test-component') |
| 13 | + return ng('generate', 'component', `${upperDirs}/test-component`) |
13 | 14 | .then(() => expectFileToExist(componentDir))
|
14 | 15 | .then(() => expectFileToExist(join(componentDir, 'test-component.component.ts')))
|
15 | 16 | .then(() => expectFileToExist(join(componentDir, 'test-component.component.spec.ts')))
|
16 | 17 | .then(() => expectFileToExist(join(componentDir, 'test-component.component.html')))
|
17 | 18 | .then(() => expectFileToExist(join(componentDir, 'test-component.component.css')))
|
18 |
| - .then(() => ng('generate', 'component', 'Upper-Dir/Test-Component-Two')) |
| 19 | + .then(() => ng('generate', 'component', `${upperDirs}/Test-Component-Two`)) |
19 | 20 | .then(() => expectFileToExist(join(componentTwoDir, 'test-component-two.component.ts')))
|
20 | 21 | .then(() => expectFileToExist(join(componentTwoDir, 'test-component-two.component.spec.ts')))
|
21 | 22 | .then(() => expectFileToExist(join(componentTwoDir, 'test-component-two.component.html')))
|
|
0 commit comments