@@ -307,6 +307,32 @@ describe('The config-generator function', () => {
307307 } ) ;
308308 } ) ;
309309
310+ describe ( 'enableStylusLoader() adds the stylus-loader' , ( ) => {
311+ it ( 'without enableStylusLoader()' , ( ) => {
312+ const config = createConfig ( ) ;
313+ config . outputPath = '/tmp/output/public-path' ;
314+ config . publicPath = '/public-path' ;
315+ config . addEntry ( 'main' , './main' ) ;
316+ // do not enable the stylus loader
317+
318+ const actualConfig = configGenerator ( config ) ;
319+
320+ expect ( JSON . stringify ( actualConfig . module . rules ) ) . to . not . contain ( 'stylus-loader' ) ;
321+ } ) ;
322+
323+ it ( 'enableStylusLoader()' , ( ) => {
324+ const config = createConfig ( ) ;
325+ config . outputPath = '/tmp/output/public-path' ;
326+ config . publicPath = '/public-path' ;
327+ config . addEntry ( 'main' , './main' ) ;
328+ config . enableStylusLoader ( ) ;
329+
330+ const actualConfig = configGenerator ( config ) ;
331+
332+ expect ( JSON . stringify ( actualConfig . module . rules ) ) . to . contain ( 'stylus-loader' ) ;
333+ } ) ;
334+ } ) ;
335+
310336 describe ( 'addLoader() adds a custom loader' , ( ) => {
311337 it ( 'addLoader()' , ( ) => {
312338 const config = createConfig ( ) ;
0 commit comments