Skip to content

Commit 38da034

Browse files
hanslBrocco
authored andcommitted
test: add e2e test for appRoot
1 parent 8b09dd3 commit 38da034

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/e2e/tests/generate/component/component-module-2.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@ import {expectFileToMatch} from '../../../utils/fs';
66

77
export default function() {
88
const root = process.cwd();
9-
const modulePath = join(root, 'src', 'app', 'app.module.ts');
9+
const modulePath = join(root, 'src/app/admin/module/module.module.ts');
1010

1111
fs.mkdirSync('./src/app/sub-dir');
1212

13-
return ng('generate', 'component', 'test-component', '--module', 'app.module.ts')
13+
return Promise.resolve()
14+
.then(() => ng('generate', 'module', 'admin/module'))
15+
.then(() => ng('generate', 'component', 'other/test-component', '--module', 'admin/module'))
1416
.then(() => expectFileToMatch(modulePath,
15-
/import { TestComponentComponent } from '.\/test-component\/test-component.component'/))
16-
17-
.then(() => process.chdir(join(root, 'src', 'app')))
18-
.then(() => ng('generate', 'component', 'test-component2', '--module', 'app.module.ts'))
19-
.then(() => expectFileToMatch(modulePath,
20-
/import { TestComponent2Component } from '.\/test-component2\/test-component2.component'/))
17+
new RegExp(/import { TestComponentComponent } /.source +
18+
/from '..\/..\/other\/test-component\/test-component.component'/.source))
2119

2220
// Try to run the unit tests.
2321
.then(() => ng('build'));

0 commit comments

Comments
 (0)