@@ -3,7 +3,7 @@ import { expectFileToMatch, writeMultipleFiles } from '../../utils/fs';
33import { ng } from '../../utils/process' ;
44import { updateJsonFile } from '../../utils/project' ;
55
6- export default async function ( ) {
6+ export default async function ( ) {
77 await writeMultipleFiles ( {
88 'src/string-style.css' : '.string-style { color: red }' ,
99 'src/input-style.css' : '.input-style { color: red }' ,
@@ -12,7 +12,7 @@ export default async function() {
1212 'src/pre-rename-lazy-style.css' : '.pre-rename-lazy-style { color: red }' ,
1313 } ) ;
1414
15- await updateJsonFile ( 'angular.json' , workspaceJson => {
15+ await updateJsonFile ( 'angular.json' , ( workspaceJson ) => {
1616 const appArchitect = workspaceJson . projects [ 'test-project' ] . architect ;
1717 appArchitect . build . options . styles = [
1818 { input : 'src/string-style.css' } ,
@@ -27,7 +27,7 @@ export default async function() {
2727 ] ;
2828 } ) ;
2929
30- await ng ( 'build' , '--extract-css' , '--configuration=development' ) ;
30+ const { stdout } = await ng ( 'build' , '--extract-css' , '--configuration=development' ) ;
3131
3232 await expectFileToMatch ( 'dist/test-project/styles.css' , '.string-style' ) ;
3333 await expectFileToMatch ( 'dist/test-project/styles.css' , '.input-style' ) ;
@@ -41,4 +41,9 @@ export default async function() {
4141 <link rel="stylesheet" href="renamed-style.css">
4242 ` ,
4343 ) ;
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+ }
4449}
0 commit comments