@@ -778,13 +778,13 @@ describe('The config-generator function', () => {
778
778
779
779
const actualConfig = configGenerator ( config ) ;
780
780
781
- 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 ) ;
781
+ 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 ) . oneOf [ 1 ] ;
782
782
expect ( imagesRule . type ) . to . equal ( 'asset/resource' ) ;
783
783
expect ( imagesRule . generator ) . to . eql ( { filename : 'images/[name].[hash:8][ext]' } ) ;
784
784
expect ( imagesRule . parser ) . to . eql ( { } ) ;
785
- expect ( imagesRule ) . to . include . keys ( 'test' , ' type', 'generator' , 'parser' ) ;
785
+ expect ( imagesRule ) . to . include . keys ( 'type' , 'generator' , 'parser' ) ;
786
786
787
- const fontsRule = findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , actualConfig . module . rules ) ;
787
+ const fontsRule = findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , actualConfig . module . rules ) . oneOf [ 1 ] ;
788
788
expect ( fontsRule . type ) . to . equal ( 'asset/resource' ) ;
789
789
expect ( fontsRule . generator ) . to . eql ( { filename : 'fonts/[name].[hash:8][ext]' } ) ;
790
790
} ) ;
@@ -801,7 +801,7 @@ describe('The config-generator function', () => {
801
801
802
802
const actualConfig = configGenerator ( config ) ;
803
803
804
- 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 ) ;
804
+ 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 ) . oneOf [ 1 ] ;
805
805
expect ( imagesRule . type ) . to . equal ( 'asset/resource' ) ;
806
806
expect ( imagesRule . generator ) . to . eql ( { filename : 'file.[hash][ext]' } ) ;
807
807
} ) ;
@@ -818,7 +818,7 @@ describe('The config-generator function', () => {
818
818
819
819
const actualConfig = configGenerator ( config ) ;
820
820
821
- 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 ) ;
821
+ 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 ) . oneOf [ 1 ] ;
822
822
expect ( imagesRule . parser ) . to . eql ( { dataUrlCondition : { maxSize : 3000 } } ) ;
823
823
} ) ;
824
824
@@ -1122,22 +1122,22 @@ describe('The config-generator function', () => {
1122
1122
1123
1123
it ( 'configure rule for "images"' , ( ) => {
1124
1124
config . configureLoaderRule ( 'images' , ( loaderRule ) => {
1125
- loaderRule . generator . filename = 'dirname-images/[hash:42][ext]' ;
1125
+ loaderRule . oneOf [ 1 ] . generator . filename = 'dirname-images/[hash:42][ext]' ;
1126
1126
} ) ;
1127
1127
1128
1128
const webpackConfig = configGenerator ( config ) ;
1129
- const rule = findRule ( / \. ( p n g | j p g | j p e g | g i f | i c o | s v g | w e b p ) $ / , webpackConfig . module . rules ) ;
1129
+ const rule = findRule ( / \. ( p n g | j p g | j p e g | g i f | i c o | s v g | w e b p ) $ / , webpackConfig . module . rules ) . oneOf [ 1 ] ;
1130
1130
1131
1131
expect ( rule . generator . filename ) . to . equal ( 'dirname-images/[hash:42][ext]' ) ;
1132
1132
} ) ;
1133
1133
1134
1134
it ( 'configure rule for "fonts"' , ( ) => {
1135
1135
config . configureLoaderRule ( 'fonts' , ( loader ) => {
1136
- loader . generator . filename = 'dirname-fonts/[hash:42][ext]' ;
1136
+ loader . oneOf [ 1 ] . generator . filename = 'dirname-fonts/[hash:42][ext]' ;
1137
1137
} ) ;
1138
1138
1139
1139
const webpackConfig = configGenerator ( config ) ;
1140
- const rule = findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , webpackConfig . module . rules ) ;
1140
+ const rule = findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , webpackConfig . module . rules ) . oneOf [ 1 ] ;
1141
1141
1142
1142
expect ( rule . generator . filename ) . to . equal ( 'dirname-fonts/[hash:42][ext]' ) ;
1143
1143
} ) ;
0 commit comments