diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index 08388359b..7b107c176 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -56,7 +56,7 @@ This rule is enabled by default. }, minArgs: { type: 'number', - minimum: 1, + minimum: 0, }, maxArgs: { type: 'number', diff --git a/src/rules/__tests__/valid-expect.test.ts b/src/rules/__tests__/valid-expect.test.ts index f30bafc66..77bcfe02b 100644 --- a/src/rules/__tests__/valid-expect.test.ts +++ b/src/rules/__tests__/valid-expect.test.ts @@ -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: [ { diff --git a/src/rules/valid-expect.ts b/src/rules/valid-expect.ts index 16bf1daa9..b31496411 100644 --- a/src/rules/valid-expect.ts +++ b/src/rules/valid-expect.ts @@ -176,7 +176,7 @@ export default createRule<[Options], MessageIds>({ }, minArgs: { type: 'number', - minimum: 1, + minimum: 0, }, maxArgs: { type: 'number',