@@ -861,10 +861,10 @@ describe('The config-generator function', () => {
861
861
const actualConfig = configGenerator ( config ) ;
862
862
863
863
const imagesRule = findRule ( / \. ( p n g | j p g | j p e g | g i f | i c o | s v g | w e b p ) $ / , actualConfig . module . rules ) ;
864
- expect ( imagesRule . loader ) . to . equal ( 'file-loader' ) ;
864
+ expect ( imagesRule . loader ) . to . contain ( 'file-loader' ) ;
865
865
866
866
const fontsRule = findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , actualConfig . module . rules ) ;
867
- expect ( fontsRule . loader ) . to . equal ( 'file-loader' ) ;
867
+ expect ( fontsRule . loader ) . to . contain ( 'file-loader' ) ;
868
868
} ) ;
869
869
870
870
it ( 'with configureUrlLoader() and missing keys' , ( ) => {
@@ -877,10 +877,10 @@ describe('The config-generator function', () => {
877
877
const actualConfig = configGenerator ( config ) ;
878
878
879
879
const imagesRule = findRule ( / \. ( p n g | j p g | j p e g | g i f | i c o | s v g | w e b p ) $ / , actualConfig . module . rules ) ;
880
- expect ( imagesRule . loader ) . to . equal ( 'file-loader' ) ;
880
+ expect ( imagesRule . loader ) . to . contain ( 'file-loader' ) ;
881
881
882
882
const fontsRule = findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , actualConfig . module . rules ) ;
883
- expect ( fontsRule . loader ) . to . equal ( 'file-loader' ) ;
883
+ expect ( fontsRule . loader ) . to . contain ( 'file-loader' ) ;
884
884
} ) ;
885
885
886
886
it ( 'with configureUrlLoader()' , ( ) => {
@@ -900,12 +900,12 @@ describe('The config-generator function', () => {
900
900
const actualConfig = configGenerator ( config ) ;
901
901
902
902
const imagesRule = findRule ( / \. ( p n g | j p g | j p e g | g i f | i c o | s v g | w e b p ) $ / , actualConfig . module . rules ) ;
903
- expect ( imagesRule . loader ) . to . equal ( 'url-loader' ) ;
903
+ expect ( imagesRule . loader ) . to . contain ( 'url-loader' ) ;
904
904
expect ( imagesRule . options . name ) . to . equal ( '[name].foo.[ext]' ) ;
905
905
expect ( imagesRule . options . limit ) . to . equal ( 8192 ) ;
906
906
907
907
const fontsRule = findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , actualConfig . module . rules ) ;
908
- expect ( fontsRule . loader ) . to . equal ( 'url-loader' ) ;
908
+ expect ( fontsRule . loader ) . to . contain ( 'url-loader' ) ;
909
909
expect ( fontsRule . options . limit ) . to . equal ( 4096 ) ;
910
910
expect ( fontsRule . options . name ) . to . equal ( '[name].bar.[ext]' ) ;
911
911
} ) ;
@@ -951,7 +951,7 @@ describe('The config-generator function', () => {
951
951
const jsRule = findRule ( / \. ( j s x ? ) $ / , actualConfig . module . rules ) ;
952
952
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 ) / ) ) ;
953
953
954
- const babelLoader = jsRule . use . find ( loader => loader . loader === 'babel- loader' ) ;
954
+ const babelLoader = jsRule . use . find ( loader => / b a b e l - l o a d e r / . test ( loader . loader ) ) ;
955
955
const babelEnvPreset = babelLoader . options . presets . find ( ( [ name ] ) => name === '@babel/preset-env' ) ;
956
956
expect ( babelEnvPreset [ 1 ] . useBuiltIns ) . to . equal ( false ) ;
957
957
} ) ;
@@ -1001,7 +1001,7 @@ describe('The config-generator function', () => {
1001
1001
const actualConfig = configGenerator ( config ) ;
1002
1002
1003
1003
const jsRule = findRule ( / \. ( j s x ? ) $ / , actualConfig . module . rules ) ;
1004
- const babelLoader = jsRule . use . find ( loader => loader . loader === 'babel- loader' ) ;
1004
+ const babelLoader = jsRule . use . find ( loader => / b a b e l - l o a d e r / . test ( loader . loader ) ) ;
1005
1005
const babelEnvPreset = babelLoader . options . presets . find ( ( [ name ] ) => name === '@babel/preset-env' ) ;
1006
1006
expect ( babelEnvPreset [ 1 ] . useBuiltIns ) . to . equal ( 'usage' ) ;
1007
1007
expect ( babelEnvPreset [ 1 ] . corejs ) . to . equal ( 3 ) ;
@@ -1018,7 +1018,7 @@ describe('The config-generator function', () => {
1018
1018
const actualConfig = configGenerator ( config ) ;
1019
1019
1020
1020
const jsRule = findRule ( / \. ( j s x ? ) $ / , actualConfig . module . rules ) ;
1021
- const babelLoader = jsRule . use . find ( loader => loader . loader === 'babel- loader' ) ;
1021
+ const babelLoader = jsRule . use . find ( loader => / b a b e l - l o a d e r / . test ( loader . loader ) ) ;
1022
1022
const babelEnvPreset = babelLoader . options . presets . find ( ( [ name ] ) => name === '@babel/preset-env' ) ;
1023
1023
expect ( babelEnvPreset [ 1 ] . useBuiltIns ) . to . equal ( false ) ;
1024
1024
} ) ;
@@ -1035,7 +1035,7 @@ describe('The config-generator function', () => {
1035
1035
const actualConfig = configGenerator ( config ) ;
1036
1036
1037
1037
const jsRule = findRule ( / \. ( j s x ? ) $ / , actualConfig . module . rules ) ;
1038
- const babelLoader = jsRule . use . find ( loader => loader . loader === 'babel- loader' ) ;
1038
+ const babelLoader = jsRule . use . find ( loader => / b a b e l - l o a d e r / . test ( loader . loader ) ) ;
1039
1039
const babelEnvPreset = babelLoader . options . presets . find ( ( [ name ] ) => name === '@babel/preset-env' ) ;
1040
1040
expect ( babelEnvPreset [ 1 ] . useBuiltIns ) . to . equal ( 'usage' ) ;
1041
1041
} ) ;
0 commit comments