From 5c8c7452ec77df26c40ad078945872d042a6ad5b Mon Sep 17 00:00:00 2001 From: Johannes Werner Date: Sat, 29 Oct 2016 20:19:51 +0200 Subject: [PATCH] test(e2e): remove false positive PR https://github.com/angular/angular-cli/pull/2646 introduced new e2e tests that give positive feedback without running all tests. --- tests/e2e/tests/build/styles/styles-array.ts | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/e2e/tests/build/styles/styles-array.ts b/tests/e2e/tests/build/styles/styles-array.ts index 8e5b6cf26007..c10f89e034df 100644 --- a/tests/e2e/tests/build/styles/styles-array.ts +++ b/tests/e2e/tests/build/styles/styles-array.ts @@ -1,11 +1,11 @@ import * as glob from 'glob'; -import {writeMultipleFiles, expectFileToMatch} from '../../../utils/fs'; -import {ng} from '../../../utils/process'; -import {updateJsonFile} from '../../../utils/project'; +import { writeMultipleFiles, expectFileToMatch } from '../../../utils/fs'; +import { ng } from '../../../utils/process'; +import { updateJsonFile } from '../../../utils/project'; -export default function() { +export default function () { return writeMultipleFiles({ 'src/styles.css': ` @import './imported-styles.css'; @@ -47,12 +47,14 @@ export default function() { .then(() => expectFileToMatch('dist/styles.bundle.js', /.upper.*.lower.*background.*#def/)) .then(() => ng('build', '--prod')) - .then(() => new Promise(() => - glob.sync('dist/styles.*.bundle.css').find(file => !!file))) + .then(() => new Promise( + (resolve) => + resolve(glob.sync('dist/styles.*.bundle.css').find(file => !!file)) + )) .then((styles) => - expectFileToMatch(styles, 'body { background-color: blue; }') - .then(() => expectFileToMatch(styles, 'p { background-color: red; }') - .then(() => expectFileToMatch(styles, /.outer.*.inner.*background:\s*#[fF]+/)) - .then(() => expectFileToMatch(styles, /.upper.*.lower.*background.*#def/))) + expectFileToMatch(styles, 'body{background-color:blue}') + .then(() => expectFileToMatch(styles, 'p{background-color:red}') + .then(() => expectFileToMatch(styles, /.outer.*.inner.*background:\s*#[fF]+/)) + .then(() => expectFileToMatch(styles, /.upper.*.lower.*background.*#def/))) ); }