Skip to content

Commit

Permalink
feat: change test-case-property-ordering to add supports languageOptions
Browse files Browse the repository at this point in the history
fixes #402

Signed-off-by: 唯然 <weiran.zsd@outlook.com>
  • Loading branch information
aladdin-add committed Apr 9, 2024
1 parent c27e18b commit 80dd4b1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rules/test-case-property-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ module.exports = {
'output',
'options',
'parser',
'parserOptions',
'languageOptions', // used in eslint flat config
'parserOptions', // used in eslintrc config
'globals',
'env',
'errors',
Expand Down
22 changes: 22 additions & 0 deletions tests/lib/rules/test-case-property-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,27 @@ ruleTester.run('test-case-property-ordering', rule, {
},
],
},
{
code: `
new RuleTester().run('foo', bar, {
valid: [
{\ncode: "foo",\noutput: "",\nerrors: ["baz"],\nlanguageOptions: "",\n},
]
});
`,
output: `
new RuleTester().run('foo', bar, {
valid: [
{\ncode: "foo",\noutput: "",\nlanguageOptions: "",\nerrors: ["baz"],\n},
]
});
`,
errors: [
{
message:
'The properties of a test case should be placed in a consistent order: [code, output, languageOptions, errors].',
},
],
},
],
});

0 comments on commit 80dd4b1

Please sign in to comment.