-
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.
feat(module): component optional when generating module (#3389)
* change URL query key name * generate component with module made optional * revert changes done to module cause open PR * components when generating module is optional * tests updated for component flag * fix parent/child compnent test to fit new flag * updated test for parent/child module generate * removed component testing from basic module e2e * adjusted e2e test for generate module * ng g m creates module only with routing flag * unit test for new generate module behavior * e2e tests for g m new behavior * remove spec test * shorten test module name to keep 100 char limit
- Loading branch information
Showing
4 changed files
with
50 additions
and
28 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import {join} from 'path'; | ||
import {ng} from '../../../utils/process'; | ||
import {expectFileToExist} from '../../../utils/fs'; | ||
import {expectToFail} from '../../../utils/utils'; | ||
|
||
|
||
export default function() { | ||
const moduleDir = join('src', 'app', 'test-module'); | ||
const moduleDir = join('src', 'app', 'test'); | ||
|
||
return ng('generate', 'module', 'test-module', '--routing') | ||
return ng('generate', 'module', 'test', '--routing') | ||
.then(() => expectFileToExist(moduleDir)) | ||
.then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test-module-routing.module.ts'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test-module.component.ts'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test-module.component.html'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test-module.component.css'))) | ||
|
||
.then(() => expectFileToExist(join(moduleDir, 'test.module.ts'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test-routing.module.ts'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test.component.ts'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test.component.spec.ts'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test.component.html'))) | ||
.then(() => expectFileToExist(join(moduleDir, 'test.component.css'))) | ||
.then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test.spec.ts')))) | ||
// Try to run the unit tests. | ||
.then(() => ng('test', '--single-run')); | ||
} |