Skip to content

Commit

Permalink
fix(valid-describe-callback): False positive with `test.describe.conf…
Browse files Browse the repository at this point in the history
…igure`
  • Loading branch information
mskelton committed Feb 27, 2024
1 parent b325718 commit 91988d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rules/valid-describe-callback.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ runRuleTester('valid-describe-callback', rule, {
},
],
valid: [
'describe.configure({ timeout: 600_000 })',
'describe("foo", function() {})',
'describe("foo", () => {})',
'test.describe.configure({ timeout: 600_000 })',
'test.describe("foo", function() {})',
'test.describe("foo", () => {})',
'test.describe(`foo`, () => {})',
Expand Down
5 changes: 5 additions & 0 deletions src/rules/valid-describe-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export default {
const call = parseFnCall(context, node);
if (call?.group !== 'describe') return;

// Ignore `describe.configure()` calls
if (call.members.some((s) => getStringValue(s) === 'configure')) {
return;
}

if (node.arguments.length < 1) {
return context.report({
loc: node.loc!,
Expand Down

0 comments on commit 91988d5

Please sign in to comment.