@@ -3,7 +3,7 @@ import { expectFileToMatch, writeMultipleFiles } from '../../utils/fs';
3
3
import { ng } from '../../utils/process' ;
4
4
import { updateJsonFile } from '../../utils/project' ;
5
5
6
- export default async function ( ) {
6
+ export default async function ( ) {
7
7
await writeMultipleFiles ( {
8
8
'src/string-style.css' : '.string-style { color: red }' ,
9
9
'src/input-style.css' : '.input-style { color: red }' ,
@@ -12,7 +12,7 @@ export default async function() {
12
12
'src/pre-rename-lazy-style.css' : '.pre-rename-lazy-style { color: red }' ,
13
13
} ) ;
14
14
15
- await updateJsonFile ( 'angular.json' , workspaceJson => {
15
+ await updateJsonFile ( 'angular.json' , ( workspaceJson ) => {
16
16
const appArchitect = workspaceJson . projects [ 'test-project' ] . architect ;
17
17
appArchitect . build . options . styles = [
18
18
{ input : 'src/string-style.css' } ,
@@ -27,7 +27,7 @@ export default async function() {
27
27
] ;
28
28
} ) ;
29
29
30
- await ng ( 'build' , '--extract-css' , '--configuration=development' ) ;
30
+ const { stdout } = await ng ( 'build' , '--extract-css' , '--configuration=development' ) ;
31
31
32
32
await expectFileToMatch ( 'dist/test-project/styles.css' , '.string-style' ) ;
33
33
await expectFileToMatch ( 'dist/test-project/styles.css' , '.input-style' ) ;
@@ -41,4 +41,9 @@ export default async function() {
41
41
<link rel="stylesheet" href="renamed-style.css">
42
42
` ,
43
43
) ;
44
+
45
+ // Non injected styles should be listed under lazy chunk files
46
+ if ( ! / L a z y C h u n k F i l e s .* \s r e n a m e d - l a z y - s t y l e \. c s s / m. test ( stdout ) ) {
47
+ throw new Error ( `Expected "renamed-lazy-style.css" to be listed under "Lazy Chunk Files".` ) ;
48
+ }
44
49
}
0 commit comments