Skip to content

Commit 9828116

Browse files
committed
fix(e2e): fix broken test pipeline
1 parent 86f2a1b commit 9828116

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

packages/angular-cli/blueprints/component/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ module.exports = {
124124
const returns = [];
125125
const className = stringUtils.classify(`${options.entity.name}Component`);
126126
const fileName = stringUtils.dasherize(`${options.entity.name}.component`);
127-
const componentDir = path.relative(path.dirname(this.pathToModule), this.generatePath).toLowerCase();
127+
const componentDir = path.relative(path.dirname(this.pathToModule), this.generatePath);
128128
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
129129

130130
if (!options['skip-import']) {

tests/e2e/tests/build/styles/styles-array.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ export default function() {
4747
.then(() => expectFileToMatch('dist/styles.bundle.js', /.upper.*.lower.*background.*#def/))
4848

4949
.then(() => ng('build', '--prod'))
50-
.then(() => new Promise<string>(() =>
51-
glob.sync('dist/styles.*.bundle.css').find(file => !!file)))
50+
.then(() => glob.sync('dist/styles.*.bundle.css').find(file => !!file))
5251
.then((styles) =>
53-
expectFileToMatch(styles, 'body { background-color: blue; }')
54-
.then(() => expectFileToMatch(styles, 'p { background-color: red; }')
52+
expectFileToMatch(styles, /body\s*\{\s*background-color:\s*blue\s*\}/)
53+
.then(() => expectFileToMatch(styles, /p\s*\{\s*background-color:\s*red\s*\}/)
5554
.then(() => expectFileToMatch(styles, /.outer.*.inner.*background:\s*#[fF]+/))
5655
.then(() => expectFileToMatch(styles, /.upper.*.lower.*background.*#def/)))
5756
);

tests/e2e/tests/generate/component/component-path-case.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@ import {expectFileToExist, createDir} from '../../../utils/fs';
44

55

66
export default function() {
7-
const rootDir = join('src', 'app', 'upper-dir');
7+
const rootDir = join('src', 'app', 'Upper-Dir');
88
const componentDir = join(rootDir.toLowerCase(), 'test-component');
99
createDir(rootDir);
1010

11-
return ng('generate', 'component', 'Upper-Dir', 'test-component')
11+
return ng('generate', 'component', 'Upper-Dir/test-component')
1212
.then(() => expectFileToExist(componentDir))
1313
.then(() => expectFileToExist(join(componentDir, 'test-component.component.ts')))
1414
.then(() => expectFileToExist(join(componentDir, 'test-component.component.spec.ts')))
1515
.then(() => expectFileToExist(join(componentDir, 'test-component.component.html')))
1616
.then(() => expectFileToExist(join(componentDir, 'test-component.component.css')))
17+
.then(() => ng('generate', 'component', 'Upper-Dir/Test-Component-Two'))
18+
.then(() => expectFileToExist(join(componentDir, 'test-component-two.component.ts')))
19+
.then(() => expectFileToExist(join(componentDir, 'test-component-two.component.spec.ts')))
20+
.then(() => expectFileToExist(join(componentDir, 'test-component-two.component.html')))
21+
.then(() => expectFileToExist(join(componentDir, 'test-component-two.component.css')))
1722

1823
// Try to run the unit tests.
1924
.then(() => ng('test', '--watch=false'));

0 commit comments

Comments
 (0)