@@ -1089,55 +1089,55 @@ describe('The config-generator function', () => {
1089
1089
it ( 'configure rule for "sass"' , ( ) => {
1090
1090
config . enableSassLoader ( ) ;
1091
1091
config . configureLoaderRule ( 'sass' , ( loaderRule ) => {
1092
- loaderRule . use [ 2 ] . options . fooBar = 'fooBar' ;
1092
+ loaderRule . oneOf [ 1 ] . use [ 2 ] . options . fooBar = 'fooBar' ;
1093
1093
} ) ;
1094
1094
1095
1095
const webpackConfig = configGenerator ( config ) ;
1096
1096
const rule = findRule ( / \. s [ a c ] s s $ / , webpackConfig . module . rules ) ;
1097
1097
1098
- expect ( rule . use [ 2 ] . options . fooBar ) . to . equal ( 'fooBar' ) ;
1098
+ expect ( rule . oneOf [ 1 ] . use [ 2 ] . options . fooBar ) . to . equal ( 'fooBar' ) ;
1099
1099
} ) ;
1100
1100
1101
1101
it ( 'configure rule for the alias "scss"' , ( ) => {
1102
1102
config . enableSassLoader ( ) ;
1103
1103
config . configureLoaderRule ( 'scss' , ( loaderRule ) => {
1104
- loaderRule . use [ 2 ] . options . fooBar = 'fooBar' ;
1104
+ loaderRule . oneOf [ 1 ] . use [ 2 ] . options . fooBar = 'fooBar' ;
1105
1105
} ) ;
1106
1106
1107
1107
const webpackConfig = configGenerator ( config ) ;
1108
1108
const rule = findRule ( / \. s [ a c ] s s $ / , webpackConfig . module . rules ) ;
1109
1109
1110
- expect ( rule . use [ 2 ] . options . fooBar ) . to . equal ( 'fooBar' ) ;
1110
+ expect ( rule . oneOf [ 1 ] . use [ 2 ] . options . fooBar ) . to . equal ( 'fooBar' ) ;
1111
1111
} ) ;
1112
1112
1113
1113
it ( 'configure rule for "less"' , ( ) => {
1114
1114
config . enableLessLoader ( ( options ) => {
1115
1115
options . optionA = 'optionA' ;
1116
1116
} ) ;
1117
1117
config . configureLoaderRule ( 'less' , ( loaderRule ) => {
1118
- loaderRule . use [ 2 ] . options . optionB = 'optionB' ;
1118
+ loaderRule . oneOf [ 1 ] . use [ 2 ] . options . optionB = 'optionB' ;
1119
1119
} ) ;
1120
1120
1121
1121
const webpackConfig = configGenerator ( config ) ;
1122
1122
const rule = findRule ( / \. l e s s / , webpackConfig . module . rules ) ;
1123
1123
1124
- expect ( rule . use [ 2 ] . options . optionA ) . to . equal ( 'optionA' ) ;
1125
- expect ( rule . use [ 2 ] . options . optionB ) . to . equal ( 'optionB' ) ;
1124
+ expect ( rule . oneOf [ 1 ] . use [ 2 ] . options . optionA ) . to . equal ( 'optionA' ) ;
1125
+ expect ( rule . oneOf [ 1 ] . use [ 2 ] . options . optionB ) . to . equal ( 'optionB' ) ;
1126
1126
} ) ;
1127
1127
1128
1128
it ( 'configure rule for "stylus"' , ( ) => {
1129
1129
config . enableStylusLoader ( ( options ) => {
1130
1130
options . optionA = 'optionA' ;
1131
1131
} ) ;
1132
1132
config . configureLoaderRule ( 'stylus' , ( loaderRule ) => {
1133
- loaderRule . use [ 2 ] . options . optionB = 'optionB' ;
1133
+ loaderRule . oneOf [ 1 ] . use [ 2 ] . options . optionB = 'optionB' ;
1134
1134
} ) ;
1135
1135
1136
1136
const webpackConfig = configGenerator ( config ) ;
1137
1137
const rule = findRule ( / \. s t y l / , webpackConfig . module . rules ) ;
1138
1138
1139
- expect ( rule . use [ 2 ] . options . optionA ) . to . equal ( 'optionA' ) ;
1140
- expect ( rule . use [ 2 ] . options . optionB ) . to . equal ( 'optionB' ) ;
1139
+ expect ( rule . oneOf [ 1 ] . use [ 2 ] . options . optionA ) . to . equal ( 'optionA' ) ;
1140
+ expect ( rule . oneOf [ 1 ] . use [ 2 ] . options . optionB ) . to . equal ( 'optionB' ) ;
1141
1141
} ) ;
1142
1142
1143
1143
it ( 'configure rule for "vue"' , ( ) => {
0 commit comments