eslint-plugin-jest 26.8.6 → 26.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,8 +32,10 @@ const suggestRemovingExtraArguments = (args, extraArgsStartAt) => ({
32
32
  fix: fixer => fixer.removeRange([args[extraArgsStartAt].range[0] - Math.sign(extraArgsStartAt), args[args.length - 1].range[1]])
33
33
  });
34
34
 
35
- const suggestions = [['suggestAddingHasAssertions', 'expect.hasAssertions();'], ['suggestAddingAssertions', 'expect.assertions();']];
36
-
35
+ // const suggestions: Array<[MessageIds, string]> = [
36
+ // ['suggestAddingHasAssertions', 'expect.hasAssertions();'],
37
+ // ['suggestAddingAssertions', 'expect.assertions();'],
38
+ // ];
37
39
  var _default = (0, _utils2.createRule)({
38
40
  name: __filename,
39
41
  meta: {
@@ -213,11 +215,7 @@ var _default = (0, _utils2.createRule)({
213
215
 
214
216
  const [, testFn] = node.arguments;
215
217
 
216
- if (!(0, _utils2.isFunction)(testFn) || testFn.body.type !== _utils.AST_NODE_TYPES.BlockStatement) {
217
- return;
218
- }
219
-
220
- if (!shouldCheckFunction(testFn)) {
218
+ if (!(0, _utils2.isFunction)(testFn) || !shouldCheckFunction(testFn)) {
221
219
  return;
222
220
  }
223
221
 
@@ -229,6 +227,12 @@ var _default = (0, _utils2.createRule)({
229
227
  return;
230
228
  }
231
229
 
230
+ const suggestions = [];
231
+
232
+ if (testFn.body.type === _utils.AST_NODE_TYPES.BlockStatement) {
233
+ suggestions.push(['suggestAddingHasAssertions', 'expect.hasAssertions();'], ['suggestAddingAssertions', 'expect.assertions();']);
234
+ }
235
+
232
236
  context.report({
233
237
  messageId: 'haveExpectAssertions',
234
238
  node,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-jest",
3
- "version": "26.8.6",
3
+ "version": "26.8.7",
4
4
  "description": "ESLint rules for Jest",
5
5
  "keywords": [
6
6
  "eslint",