Skip to content

Commit 9dd6ca4

Browse files
committed
chore(tests): correct some tests due to last feature for CSSModules
1 parent 4dbe443 commit 9dd6ca4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/config-generator.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,55 +1089,55 @@ describe('The config-generator function', () => {
10891089
it('configure rule for "sass"', () => {
10901090
config.enableSassLoader();
10911091
config.configureLoaderRule('sass', (loaderRule) => {
1092-
loaderRule.use[2].options.fooBar = 'fooBar';
1092+
loaderRule.oneOf[1].use[2].options.fooBar = 'fooBar';
10931093
});
10941094

10951095
const webpackConfig = configGenerator(config);
10961096
const rule = findRule(/\.s[ac]ss$/, webpackConfig.module.rules);
10971097

1098-
expect(rule.use[2].options.fooBar).to.equal('fooBar');
1098+
expect(rule.oneOf[1].use[2].options.fooBar).to.equal('fooBar');
10991099
});
11001100

11011101
it('configure rule for the alias "scss"', () => {
11021102
config.enableSassLoader();
11031103
config.configureLoaderRule('scss', (loaderRule) => {
1104-
loaderRule.use[2].options.fooBar = 'fooBar';
1104+
loaderRule.oneOf[1].use[2].options.fooBar = 'fooBar';
11051105
});
11061106

11071107
const webpackConfig = configGenerator(config);
11081108
const rule = findRule(/\.s[ac]ss$/, webpackConfig.module.rules);
11091109

1110-
expect(rule.use[2].options.fooBar).to.equal('fooBar');
1110+
expect(rule.oneOf[1].use[2].options.fooBar).to.equal('fooBar');
11111111
});
11121112

11131113
it('configure rule for "less"', () => {
11141114
config.enableLessLoader((options) => {
11151115
options.optionA = 'optionA';
11161116
});
11171117
config.configureLoaderRule('less', (loaderRule) => {
1118-
loaderRule.use[2].options.optionB = 'optionB';
1118+
loaderRule.oneOf[1].use[2].options.optionB = 'optionB';
11191119
});
11201120

11211121
const webpackConfig = configGenerator(config);
11221122
const rule = findRule(/\.less/, webpackConfig.module.rules);
11231123

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');
11261126
});
11271127

11281128
it('configure rule for "stylus"', () => {
11291129
config.enableStylusLoader((options) => {
11301130
options.optionA = 'optionA';
11311131
});
11321132
config.configureLoaderRule('stylus', (loaderRule) => {
1133-
loaderRule.use[2].options.optionB = 'optionB';
1133+
loaderRule.oneOf[1].use[2].options.optionB = 'optionB';
11341134
});
11351135

11361136
const webpackConfig = configGenerator(config);
11371137
const rule = findRule(/\.styl/, webpackConfig.module.rules);
11381138

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');
11411141
});
11421142

11431143
it('configure rule for "vue"', () => {

0 commit comments

Comments
 (0)