@@ -52,10 +52,10 @@ type MessageIds =
5252 | 'suggestAddingAssertions'
5353 | 'suggestRemovingExtraArguments' ;
5454
55- const suggestions : Array < [ MessageIds , string ] > = [
56- [ 'suggestAddingHasAssertions' , 'expect.hasAssertions();' ] ,
57- [ 'suggestAddingAssertions' , 'expect.assertions();' ] ,
58- ] ;
55+ // const suggestions: Array<[MessageIds, string]> = [
56+ // ['suggestAddingHasAssertions', 'expect.hasAssertions();'],
57+ // ['suggestAddingAssertions', 'expect.assertions();'],
58+ // ];
5959
6060export default createRule < [ RuleOptions ] , MessageIds > ( {
6161 name : __filename ,
@@ -248,14 +248,7 @@ export default createRule<[RuleOptions], MessageIds>({
248248
249249 const [ , testFn ] = node . arguments ;
250250
251- if (
252- ! isFunction ( testFn ) ||
253- testFn . body . type !== AST_NODE_TYPES . BlockStatement
254- ) {
255- return ;
256- }
257-
258- if ( ! shouldCheckFunction ( testFn ) ) {
251+ if ( ! isFunction ( testFn ) || ! shouldCheckFunction ( testFn ) ) {
259252 return ;
260253 }
261254
@@ -268,6 +261,15 @@ export default createRule<[RuleOptions], MessageIds>({
268261 return ;
269262 }
270263
264+ const suggestions : Array < [ MessageIds , string ] > = [ ] ;
265+
266+ if ( testFn . body . type === AST_NODE_TYPES . BlockStatement ) {
267+ suggestions . push (
268+ [ 'suggestAddingHasAssertions' , 'expect.hasAssertions();' ] ,
269+ [ 'suggestAddingAssertions' , 'expect.assertions();' ] ,
270+ ) ;
271+ }
272+
271273 context . report ( {
272274 messageId : 'haveExpectAssertions' ,
273275 node,
0 commit comments