Skip to content

Commit

Permalink
fix(valid-describe): don't check arguments of describe.each
Browse files Browse the repository at this point in the history
Fixes #463
  • Loading branch information
G-Rath committed Oct 31, 2019
1 parent 2224c95 commit 63472e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/rules/__tests__/valid-describe.test.ts
Expand Up @@ -16,6 +16,7 @@ ruleTester.run('valid-describe', rule, {
'describe["each"](() => {})("foo")',
'describe["each"]()(() => {})',
'describe["each"]("foo")(() => {})',
'describe.each([1, 2, 3])("%s", (a, b) => {});',
'describe("foo", function() {})',
'describe("foo", () => {})',
'describe(`foo`, () => {})',
Expand Down
3 changes: 2 additions & 1 deletion src/rules/valid-describe.ts
Expand Up @@ -6,6 +6,7 @@ import {
createRule,
getJestFunctionArguments,
isDescribe,
isDescribeEach,
isFunction,
} from './utils';

Expand Down Expand Up @@ -85,7 +86,7 @@ export default createRule({
});
}

if (callback.params.length) {
if (!isDescribeEach(node) && callback.params.length) {
context.report({
messageId: 'unexpectedDescribeArgument',
loc: paramsLocation(callback.params),
Expand Down

0 comments on commit 63472e2

Please sign in to comment.