Skip to content

Commit a2cc811

Browse files
committed
[Tests] add tests for exclusion of unsupported nodes
1 parent 44101a6 commit a2cc811

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/src/rules/order.js

+31
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,37 @@ ruleTester.run('order', rule, {
12321232
alphabetize: { order: 'asc' },
12331233
}],
12341234
}),
1235+
// ensure other assignments are untouched
1236+
test({
1237+
code: `
1238+
var exports = null;
1239+
var module = null;
1240+
module.exports.U = { };
1241+
module.exports.N = { };
1242+
module.exports.C = { };
1243+
exports.L = { };
1244+
exports.E = { };
1245+
`,
1246+
options: [{
1247+
named: {
1248+
cjsExports: true,
1249+
},
1250+
alphabetize: { order: 'asc' },
1251+
}],
1252+
}),
1253+
test({
1254+
code: `
1255+
exports["B"] = { };
1256+
exports["C"] = { };
1257+
exports["A"] = { };
1258+
`,
1259+
options: [{
1260+
named: {
1261+
cjsExports: true,
1262+
},
1263+
alphabetize: { order: 'asc' },
1264+
}],
1265+
}),
12351266
],
12361267
invalid: [
12371268
// builtin before external module (require)

0 commit comments

Comments
 (0)