Skip to content

Commit

Permalink
feat: Allow minArgs 0 for valid-expect
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Dec 20, 2024
1 parent 5b59029 commit 3a7fed7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/rules/valid-expect.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This rule is enabled by default.
},
minArgs: {
type: 'number',
minimum: 1,
minimum: 0,
},
maxArgs: {
type: 'number',
Expand Down
4 changes: 4 additions & 0 deletions src/rules/__tests__/valid-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ ruleTester.run('valid-expect', rule, {
code: 'test("valid-expect", async () => { expect(Promise.resolve(2)).toResolve(); });',
options: [{ asyncMatchers: ['toResolveWith'] }],
},
{
code: 'expect().pass();',
options: [{ minArgs: 0 }],
},
],
invalid: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/rules/valid-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default createRule<[Options], MessageIds>({
},
minArgs: {
type: 'number',
minimum: 1,
minimum: 0,
},
maxArgs: {
type: 'number',
Expand Down

0 comments on commit 3a7fed7

Please sign in to comment.