@@ -124,6 +124,56 @@ describe('Browser Builder styles', () => {
124
124
await browserBuild ( architect , host , target , { extractCss : true } ) ;
125
125
} ) ;
126
126
127
+ it ( 'supports autoprefixer with inline component styles in JIT mode' , async ( ) => {
128
+ host . writeMultipleFiles ( {
129
+ './src/app/app.component.ts' : `
130
+ import { Component } from '@angular/core';
131
+
132
+ @Component({
133
+ selector: 'app-root',
134
+ templateUrl: './app.component.html',
135
+ styles: ['div { flex: 1 }'],
136
+ })
137
+ export class AppComponent {
138
+ title = 'app';
139
+ }
140
+ ` ,
141
+ '.browserslistrc' : 'IE 10' ,
142
+ } ) ;
143
+
144
+ // Set target to ES5 to avoid differential loading and unnecessary testing time
145
+ host . replaceInFile ( 'tsconfig.json' , '"target": "es2017"' , '"target": "es5"' ) ;
146
+
147
+ const { files } = await browserBuild ( architect , host , target , { aot : false } ) ;
148
+
149
+ expect ( await files [ 'main.js' ] ) . toContain ( '-ms-flex: 1;' ) ;
150
+ } ) ;
151
+
152
+ it ( 'supports autoprefixer with inline component styles in AOT mode' , async ( ) => {
153
+ host . writeMultipleFiles ( {
154
+ './src/app/app.component.ts' : `
155
+ import { Component } from '@angular/core';
156
+
157
+ @Component({
158
+ selector: 'app-root',
159
+ templateUrl: './app.component.html',
160
+ styles: ['div { flex: 1 }'],
161
+ })
162
+ export class AppComponent {
163
+ title = 'app';
164
+ }
165
+ ` ,
166
+ '.browserslistrc' : 'IE 10' ,
167
+ } ) ;
168
+
169
+ // Set target to ES5 to avoid differential loading and unnecessary testing time
170
+ host . replaceInFile ( 'tsconfig.json' , '"target": "es2017"' , '"target": "es5"' ) ;
171
+
172
+ const { files } = await browserBuild ( architect , host , target , { aot : true } ) ;
173
+
174
+ expect ( await files [ 'main.js' ] ) . toContain ( '-ms-flex: 1;' ) ;
175
+ } ) ;
176
+
127
177
extensionsWithImportSupport . forEach ( ext => {
128
178
it ( `supports imports in ${ ext } files` , async ( ) => {
129
179
host . writeMultipleFiles ( {
@@ -456,7 +506,8 @@ describe('Browser Builder styles', () => {
456
506
main = await files [ 'main.js' ] ;
457
507
expect ( styles ) . toContain ( `url('/assets/global-img-absolute.svg')` ) ;
458
508
expect ( main ) . toContain ( `url('/assets/component-img-absolute.svg')` ) ;
459
- } ) ;
509
+ // NOTE: Timeout for large amount of builds in test. Test should be split up when refactored.
510
+ } , 4 * 60 * 1000 ) ;
460
511
461
512
it ( `supports bootstrap@4 with full path` , async ( ) => {
462
513
const bootstrapPath = dirname ( require . resolve ( 'bootstrap/package.json' ) ) ;
0 commit comments