@@ -326,6 +326,37 @@ describe('Basic end-to-end Workflow', function () {
326
326
sh . rm ( '-f' , scssPartialFile ) ;
327
327
} ) ;
328
328
329
+ it_not_mobile ( 'Supports sass in styleUrls' , function ( ) {
330
+ this . timeout ( 420000 ) ;
331
+
332
+ let cssFilename = 'app.component.css' ;
333
+ let sassFilename = 'app.component.sass' ;
334
+ let componentPath = path . join ( process . cwd ( ) , 'src' , 'app' ) ;
335
+ let componentFile = path . join ( componentPath , 'app.component.ts' ) ;
336
+ let cssFile = path . join ( componentPath , cssFilename ) ;
337
+ let sassFile = path . join ( componentPath , sassFilename ) ;
338
+ let sassExample = '@import "app.component.partial";\n\n.outer\n .inner\n background: #fff' ;
339
+ let sassPartialFile = path . join ( componentPath , '_app.component.partial.sass' ) ;
340
+ let sassPartialExample = '.partial\n @extend .outer' ;
341
+ let componentContents = fs . readFileSync ( componentFile , 'utf8' ) ;
342
+
343
+ sh . mv ( cssFile , sassFile ) ;
344
+ fs . writeFileSync ( sassFile , sassExample , 'utf8' ) ;
345
+ fs . writeFileSync ( sassPartialFile , sassPartialExample , 'utf8' ) ;
346
+ fs . writeFileSync ( componentFile , componentContents . replace ( new RegExp ( cssFilename , 'g' ) , sassFilename ) , 'utf8' ) ;
347
+
348
+ sh . exec ( `${ ngBin } build` ) ;
349
+ let destCssBundle = path . join ( process . cwd ( ) , 'dist' , 'main.bundle.js' ) ;
350
+ let contents = fs . readFileSync ( destCssBundle , 'utf8' ) ;
351
+ expect ( contents ) . to . include ( '.outer .inner' ) ;
352
+ expect ( contents ) . to . include ( '.partial .inner' ) ;
353
+
354
+ sh . mv ( sassFile , cssFile ) ;
355
+ fs . writeFileSync ( cssFile , '' , 'utf8' ) ;
356
+ fs . writeFileSync ( componentFile , componentContents , 'utf8' ) ;
357
+ sh . rm ( '-f' , sassPartialFile ) ;
358
+ } ) ;
359
+
329
360
// Mobile mode doesn't have styles
330
361
it_not_mobile ( 'Supports less in styleUrls' , function ( ) {
331
362
this . timeout ( 420000 ) ;
0 commit comments