|
1 | 1 | import * as glob from 'glob';
|
2 | 2 |
|
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'; |
6 | 6 |
|
7 | 7 |
|
8 |
| -export default function() { |
| 8 | +export default function () { |
9 | 9 | return writeMultipleFiles({
|
10 | 10 | 'src/styles.css': `
|
11 | 11 | @import './imported-styles.css';
|
@@ -47,12 +47,14 @@ export default function() {
|
47 | 47 | .then(() => expectFileToMatch('dist/styles.bundle.js', /.upper.*.lower.*background.*#def/))
|
48 | 48 |
|
49 | 49 | .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 | + )) |
52 | 54 | .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/))) |
57 | 59 | );
|
58 | 60 | }
|
0 commit comments