File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const ruleTester = new RuleTester({
1111
1212ruleTester . run ( 'no-empty-title' , rule , {
1313 valid : [
14+ 'describe()' ,
1415 'someFn("", function () {})' ,
1516 'describe(1, function () {})' ,
1617 'describe("foo", function () {})' ,
Original file line number Diff line number Diff line change @@ -125,18 +125,24 @@ const isTestCase = node =>
125125 testCaseNames [ getNodeName ( node . callee ) ] ;
126126
127127const isDescribe = node =>
128- node . type === 'CallExpression' && describeAliases [ getNodeName ( node . callee ) ] ;
128+ node &&
129+ node . type === 'CallExpression' &&
130+ describeAliases [ getNodeName ( node . callee ) ] ;
129131
130132const isFunction = node =>
131- node . type === 'FunctionExpression' || node . type === 'ArrowFunctionExpression' ;
133+ node &&
134+ ( node . type === 'FunctionExpression' ||
135+ node . type === 'ArrowFunctionExpression' ) ;
132136
133137const isString = node =>
134- ( node . type === 'Literal' && typeof node . value === 'string' ) ||
135- isTemplateLiteral ( node ) ;
138+ node &&
139+ ( ( node . type === 'Literal' && typeof node . value === 'string' ) ||
140+ isTemplateLiteral ( node ) ) ;
136141
137- const isTemplateLiteral = node => node . type === 'TemplateLiteral' ;
142+ const isTemplateLiteral = node => node && node . type === 'TemplateLiteral' ;
138143
139- const hasExpressions = node => node . expressions && node . expressions . length > 0 ;
144+ const hasExpressions = node =>
145+ node && node . expressions && node . expressions . length > 0 ;
140146
141147const getStringValue = arg =>
142148 isTemplateLiteral ( arg ) ? arg . quasis [ 0 ] . value . raw : arg . value ;
You can’t perform that action at this time.
0 commit comments