Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions tests/e2e/tests/build/styles/styles-array.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -47,12 +47,14 @@ export default function() {
.then(() => expectFileToMatch('dist/styles.bundle.js', /.upper.*.lower.*background.*#def/))

.then(() => ng('build', '--prod'))
.then(() => new Promise<string>(() =>
glob.sync('dist/styles.*.bundle.css').find(file => !!file)))
.then(() => new Promise<string>(
(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/)))
);
}