-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(generate): correct component path when module is generated in sub…
- Loading branch information
Showing
3 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/e2e/tests/generate/module/module-routing-child-folder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as fs from 'fs-extra'; | ||
import { join } from 'path'; | ||
import { ng } from '../../../utils/process'; | ||
import { expectFileToExist } from '../../../utils/fs'; | ||
import { expectToFail } from '../../../utils/utils'; | ||
|
||
|
||
const Promise = require('angular-cli/ember-cli/lib/ext/promise'); | ||
|
||
export default function () { | ||
const root = process.cwd(); | ||
const testPath = join(root, 'src', 'app'); | ||
|
||
process.chdir(testPath); | ||
fs.mkdirSync('./sub-dir'); | ||
|
||
return Promise.resolve() | ||
.then(() => | ||
ng('generate', 'module', 'sub-dir/child', '--routing') | ||
.then(() => expectFileToExist(join(testPath, 'sub-dir/child'))) | ||
.then(() => expectFileToExist(join(testPath, 'sub-dir/child', 'child.module.ts'))) | ||
.then(() => expectFileToExist(join(testPath, 'sub-dir/child', 'child-routing.module.ts'))) | ||
.then(() => expectFileToExist(join(testPath, 'sub-dir/child', 'child.component.ts'))) | ||
.then(() => expectFileToExist(join(testPath, 'sub-dir/child', 'child.component.spec.ts'))) | ||
.then(() => expectFileToExist(join(testPath, 'sub-dir/child', 'child.component.html'))) | ||
.then(() => expectFileToExist(join(testPath, 'sub-dir/child', 'child.component.css'))) | ||
.then(() => expectToFail(() => | ||
expectFileToExist(join(testPath, 'sub-dir/child', 'child.spec.ts')) | ||
)) | ||
// Try to run the unit tests. | ||
.then(() => ng('test', '--single-run')) | ||
); | ||
} |