@@ -778,13 +778,13 @@ describe('The config-generator function', () => {
778778
779779 const actualConfig = configGenerator ( config ) ;
780780
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 ] ;
782782 expect ( imagesRule . type ) . to . equal ( 'asset/resource' ) ;
783783 expect ( imagesRule . generator ) . to . eql ( { filename : 'images/[name].[hash:8][ext]' } ) ;
784784 expect ( imagesRule . parser ) . to . eql ( { } ) ;
785- expect ( imagesRule ) . to . include . keys ( 'test' , ' type', 'generator' , 'parser' ) ;
785+ expect ( imagesRule ) . to . include . keys ( 'type' , 'generator' , 'parser' ) ;
786786
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 ] ;
788788 expect ( fontsRule . type ) . to . equal ( 'asset/resource' ) ;
789789 expect ( fontsRule . generator ) . to . eql ( { filename : 'fonts/[name].[hash:8][ext]' } ) ;
790790 } ) ;
@@ -801,7 +801,7 @@ describe('The config-generator function', () => {
801801
802802 const actualConfig = configGenerator ( config ) ;
803803
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 ] ;
805805 expect ( imagesRule . type ) . to . equal ( 'asset/resource' ) ;
806806 expect ( imagesRule . generator ) . to . eql ( { filename : 'file.[hash][ext]' } ) ;
807807 } ) ;
@@ -818,7 +818,7 @@ describe('The config-generator function', () => {
818818
819819 const actualConfig = configGenerator ( config ) ;
820820
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 ] ;
822822 expect ( imagesRule . parser ) . to . eql ( { dataUrlCondition : { maxSize : 3000 } } ) ;
823823 } ) ;
824824
@@ -1122,22 +1122,22 @@ describe('The config-generator function', () => {
11221122
11231123 it ( 'configure rule for "images"' , ( ) => {
11241124 config . configureLoaderRule ( 'images' , ( loaderRule ) => {
1125- loaderRule . generator . filename = 'dirname-images/[hash:42][ext]' ;
1125+ loaderRule . oneOf [ 1 ] . generator . filename = 'dirname-images/[hash:42][ext]' ;
11261126 } ) ;
11271127
11281128 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 ] ;
11301130
11311131 expect ( rule . generator . filename ) . to . equal ( 'dirname-images/[hash:42][ext]' ) ;
11321132 } ) ;
11331133
11341134 it ( 'configure rule for "fonts"' , ( ) => {
11351135 config . configureLoaderRule ( 'fonts' , ( loader ) => {
1136- loader . generator . filename = 'dirname-fonts/[hash:42][ext]' ;
1136+ loader . oneOf [ 1 ] . generator . filename = 'dirname-fonts/[hash:42][ext]' ;
11371137 } ) ;
11381138
11391139 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 ] ;
11411141
11421142 expect ( rule . generator . filename ) . to . equal ( 'dirname-fonts/[hash:42][ext]' ) ;
11431143 } ) ;
0 commit comments