@@ -31,6 +31,7 @@ describe('loaders/css', () => {
3131 expect ( actualLoaders ) . to . have . lengthOf ( 1 ) ;
3232 expect ( actualLoaders [ 0 ] . options . sourceMap ) . to . be . true ;
3333 expect ( actualLoaders [ 0 ] . options . minimize ) . to . be . false ;
34+ expect ( actualLoaders [ 0 ] . options . modules ) . to . be . false ;
3435 } ) ;
3536
3637 it ( 'getLoaders() for production' , ( ) => {
@@ -42,6 +43,7 @@ describe('loaders/css', () => {
4243 expect ( actualLoaders ) . to . have . lengthOf ( 1 ) ;
4344 expect ( actualLoaders [ 0 ] . options . sourceMap ) . to . be . false ;
4445 expect ( actualLoaders [ 0 ] . options . minimize ) . to . be . true ;
46+ expect ( actualLoaders [ 0 ] . options . modules ) . to . be . false ;
4547 } ) ;
4648
4749 it ( 'getLoaders() with options callback' , ( ) => {
@@ -56,6 +58,22 @@ describe('loaders/css', () => {
5658 expect ( actualLoaders ) . to . have . lengthOf ( 1 ) ;
5759 expect ( actualLoaders [ 0 ] . options . minimize ) . to . be . true ;
5860 expect ( actualLoaders [ 0 ] . options . url ) . to . be . false ;
61+ expect ( actualLoaders [ 0 ] . options . modules ) . to . be . false ;
62+ } ) ;
63+
64+ it ( 'getLoaders() with CSS modules enabled' , ( ) => {
65+ const config = createConfig ( ) ;
66+
67+ config . configureCssLoader ( function ( options ) {
68+ options . minimize = true ;
69+ options . url = false ;
70+ } ) ;
71+
72+ const actualLoaders = cssLoader . getLoaders ( config , true ) ;
73+ expect ( actualLoaders ) . to . have . lengthOf ( 1 ) ;
74+ expect ( actualLoaders [ 0 ] . options . minimize ) . to . be . true ;
75+ expect ( actualLoaders [ 0 ] . options . url ) . to . be . false ;
76+ expect ( actualLoaders [ 0 ] . options . modules ) . to . be . true ;
5977 } ) ;
6078
6179 describe ( 'getLoaders() with PostCSS' , ( ) => {
0 commit comments