Skip to content

Commit

Permalink
Fix no-identical-title when there is no title
Browse files Browse the repository at this point in the history
Fixes #317.
  • Loading branch information
novemberborn committed Sep 18, 2021
1 parent c1cd7da commit cf361f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rules/no-identical-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const create = context => {
const titleNode = args.length > 1 || ava.hasTestModifier('todo') ? args[0] : undefined;

// Don't flag computed titles
if (!isStatic(titleNode)) {
if (!titleNode || !isStatic(titleNode)) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions test/no-identical-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ruleTester.run('no-identical-title', rule, {
` ${header}
const macro = (t, value) => { t.true(value); };
test(macro, true);
test('should work', macro, true);
test('should fail', macro, false);
`,
Expand Down

0 comments on commit cf361f1

Please sign in to comment.