File tree 1 file changed +39
-0
lines changed
tests/e2e/tests/build/styles
1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ import {
2
+ writeMultipleFiles ,
3
+ deleteFile ,
4
+ expectFileToMatch ,
5
+ replaceInFile
6
+ } from '../../../utils/fs' ;
7
+ import { ng } from '../../../utils/process' ;
8
+ import { stripIndents } from 'common-tags' ;
9
+ import { updateJsonFile } from '../../../utils/project' ;
10
+ import { expectToFail } from '../../../utils/utils' ;
11
+
12
+ export default function ( ) {
13
+ return writeMultipleFiles ( {
14
+ 'src/styles.scss' : stripIndents `
15
+ @import './imported-styles.scss';
16
+ body { background-color: blue; }
17
+ ` ,
18
+ 'src/imported-styles.scss' : stripIndents `
19
+ p { background-color: red; }
20
+ ` ,
21
+ 'src/app/app.component.scss' : stripIndents `
22
+ .outer {
23
+ .inner {
24
+ background: #fff;
25
+ }
26
+ }
27
+ ` } )
28
+ . then ( ( ) => deleteFile ( 'src/app/app.component.css' ) )
29
+ . then ( ( ) => updateJsonFile ( 'angular-cli.json' , configJson => {
30
+ const app = configJson [ 'apps' ] [ 0 ] ;
31
+ app [ 'styles' ] = [ 'styles.scss' ] ;
32
+ } ) )
33
+ . then ( ( ) => replaceInFile ( 'src/app/app.component.ts' ,
34
+ './app.component.css' , './app.component.scss' ) )
35
+ . then ( ( ) => ng ( 'build' ) )
36
+ . then ( ( ) => expectToFail ( ( ) => expectFileToMatch ( 'dist/styles.bundle.css' , / e x p o r t s / ) ) )
37
+ . then ( ( ) => expectToFail ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' ,
38
+ / " .* m o d u l e \. e x p o r t s .* \. o u t e r .* b a c k g r o u n d : / ) ) ) ;
39
+ }
You can’t perform that action at this time.
0 commit comments