Skip to content

Commit

Permalink
[Tests] add tests for exclusion of unsupported nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Sep 4, 2024
1 parent 44101a6 commit a2cc811
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/src/rules/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,37 @@ ruleTester.run('order', rule, {
alphabetize: { order: 'asc' },
}],
}),
// ensure other assignments are untouched
test({
code: `
var exports = null;
var module = null;
module.exports.U = { };
module.exports.N = { };
module.exports.C = { };
exports.L = { };
exports.E = { };
`,
options: [{
named: {
cjsExports: true,
},
alphabetize: { order: 'asc' },
}],
}),
test({
code: `
exports["B"] = { };
exports["C"] = { };
exports["A"] = { };
`,
options: [{
named: {
cjsExports: true,
},
alphabetize: { order: 'asc' },
}],
}),
],
invalid: [
// builtin before external module (require)
Expand Down

0 comments on commit a2cc811

Please sign in to comment.