Skip to content

Commit

Permalink
fix(valid-describe): false positive with template describe.each (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
idan-at authored Mar 8, 2021
1 parent 104e771 commit aa946a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/rules/__tests__/valid-describe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ ruleTester.run('valid-describe', rule, {
if (hasOwnProperty(obj, key)) {
}
`,
dedent`
describe.each\`
something | other
${1} | ${2} |
\`
("$something", ({ something, other }) => { });
`,
],
invalid: [
{
Expand Down
5 changes: 4 additions & 1 deletion src/rules/valid-describe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ export default createRule({
create(context) {
return {
CallExpression(node) {
if (!isDescribe(node)) {
if (
!isDescribe(node) ||
node.callee.type === AST_NODE_TYPES.TaggedTemplateExpression
) {
return;
}

Expand Down

0 comments on commit aa946a6

Please # to comment.