Skip to content
Permalink
Browse files
fix(valid-title): check if node has arguments first (#436)
  • Loading branch information
G-Rath committed Oct 23, 2019
1 parent 7eae625 commit e961e21e3314258660ec521d2bfaedf11823dbb1
Showing with 6 additions and 0 deletions.
  1. +4 −0 src/rules/__tests__/valid-title.test.ts
  2. +2 −0 src/rules/valid-title.ts
@@ -9,6 +9,10 @@ const ruleTester = new TSESLint.RuleTester({

ruleTester.run('no-accidental-space', rule, {
valid: [
'it()',
'describe()',
'it("")',
'it.each()()',
'describe("foo", function () {})',
'describe(6, function () {})',
'fdescribe("foo", function () {})',
@@ -39,6 +39,8 @@ export default createRule({
CallExpression(node) {
if (!isDescribe(node) && !isTestCase(node)) return;

if (!node.arguments.length) return;

const title = getNodeTitle(node);
if (!title) return;

0 comments on commit e961e21

Please sign in to comment.