@@ -826,6 +826,35 @@ describe('The config-generator function', () => {
826826 } ) ;
827827 } ) ;
828828
829+ describe ( 'Test configureBabel()' , ( ) => {
830+ it ( 'without configureBabel()' , ( ) => {
831+ const config = createConfig ( ) ;
832+ config . outputPath = '/tmp/output/public-path' ;
833+ config . publicPath = '/public-path' ;
834+ config . addEntry ( 'main' , './main' ) ;
835+
836+ const actualConfig = configGenerator ( config ) ;
837+
838+ const jsRule = findRule ( / \. j s x ? $ / , actualConfig . module . rules ) ;
839+ expect ( String ( jsRule . exclude ) ) . to . equal ( String ( / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ) ) ;
840+ } ) ;
841+
842+ it ( 'with configureBabel() and a different exclude rule' , ( ) => {
843+ const config = createConfig ( ) ;
844+ config . outputPath = '/tmp/output/public-path' ;
845+ config . publicPath = '/public-path' ;
846+ config . addEntry ( 'main' , './main' ) ;
847+ config . configureBabel ( ( ) => { } , {
848+ exclude : / f o o /
849+ } ) ;
850+
851+ const actualConfig = configGenerator ( config ) ;
852+
853+ const jsRule = findRule ( / \. j s x ? $ / , actualConfig . module . rules ) ;
854+ expect ( String ( jsRule . exclude ) ) . to . equal ( String ( / f o o / ) ) ;
855+ } ) ;
856+ } ) ;
857+
829858 describe ( 'Test shouldSplitEntryChunks' , ( ) => {
830859 it ( 'Not production' , ( ) => {
831860 const config = createConfig ( ) ;
0 commit comments