Skip to content

Commit 5c8c745

Browse files
committed
test(e2e): remove false positive
PR angular#2646 introduced new e2e tests that give positive feedback without running all tests.
1 parent 30cc482 commit 5c8c745

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

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

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as glob from 'glob';
22

3-
import {writeMultipleFiles, expectFileToMatch} from '../../../utils/fs';
4-
import {ng} from '../../../utils/process';
5-
import {updateJsonFile} from '../../../utils/project';
3+
import { writeMultipleFiles, expectFileToMatch } from '../../../utils/fs';
4+
import { ng } from '../../../utils/process';
5+
import { updateJsonFile } from '../../../utils/project';
66

77

8-
export default function() {
8+
export default function () {
99
return writeMultipleFiles({
1010
'src/styles.css': `
1111
@import './imported-styles.css';
@@ -47,12 +47,14 @@ 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(() => new Promise<string>(
51+
(resolve) =>
52+
resolve(glob.sync('dist/styles.*.bundle.css').find(file => !!file))
53+
))
5254
.then((styles) =>
53-
expectFileToMatch(styles, 'body { background-color: blue; }')
54-
.then(() => expectFileToMatch(styles, 'p { background-color: red; }')
55-
.then(() => expectFileToMatch(styles, /.outer.*.inner.*background:\s*#[fF]+/))
56-
.then(() => expectFileToMatch(styles, /.upper.*.lower.*background.*#def/)))
55+
expectFileToMatch(styles, 'body{background-color:blue}')
56+
.then(() => expectFileToMatch(styles, 'p{background-color:red}')
57+
.then(() => expectFileToMatch(styles, /.outer.*.inner.*background:\s*#[fF]+/))
58+
.then(() => expectFileToMatch(styles, /.upper.*.lower.*background.*#def/)))
5759
);
5860
}

0 commit comments

Comments
 (0)