eslint-plugin-jest 26.1.0 → 26.1.3

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.
@@ -118,7 +118,7 @@ a native loop.
118
118
  "rules": {
119
119
  "jest/prefer-expect-assertions": [
120
120
  "warn",
121
- { "onlyFunctionsWithAsyncKeyword": true }
121
+ { "onlyFunctionsWithExpectInLoop": true }
122
122
  ]
123
123
  }
124
124
  }
@@ -14,10 +14,26 @@ const isSnapshotMatcher = matcher => {
14
14
  };
15
15
 
16
16
  const isSnapshotMatcherWithoutHint = matcher => {
17
- var _matcher$arguments;
17
+ if (!matcher.arguments || matcher.arguments.length === 0) {
18
+ return true;
19
+ } // this matcher only supports one argument which is the hint
18
20
 
19
- const expectedNumberOfArgumentsWithHint = 1 + Number(matcher.name === 'toMatchSnapshot');
20
- return ((_matcher$arguments = matcher.arguments) === null || _matcher$arguments === void 0 ? void 0 : _matcher$arguments.length) !== expectedNumberOfArgumentsWithHint;
21
+
22
+ if (matcher.name !== 'toMatchSnapshot') {
23
+ return matcher.arguments.length !== 1;
24
+ } // if we're being passed two arguments,
25
+ // the second one should be the hint
26
+
27
+
28
+ if (matcher.arguments.length === 2) {
29
+ return false;
30
+ }
31
+
32
+ const [arg] = matcher.arguments; // the first argument to `toMatchSnapshot` can be _either_ a snapshot hint or
33
+ // an object with asymmetric matchers, so we can't just assume that the first
34
+ // argument is a hint when it's by itself.
35
+
36
+ return !(0, _utils.isStringNode)(arg);
21
37
  };
22
38
 
23
39
  const messages = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-jest",
3
- "version": "26.1.0",
3
+ "version": "26.1.3",
4
4
  "description": "ESLint rules for Jest",
5
5
  "keywords": [
6
6
  "eslint",
@@ -118,7 +118,7 @@
118
118
  "jest": "^27.0.0",
119
119
  "jest-runner-eslint": "^1.0.0",
120
120
  "lint-staged": "^12.0.0",
121
- "pinst": "^2.0.0",
121
+ "pinst": "^3.0.0",
122
122
  "prettier": "^2.0.5",
123
123
  "rimraf": "^3.0.0",
124
124
  "semantic-release": "^19.0.0",
@@ -139,7 +139,7 @@
139
139
  }
140
140
  },
141
141
  "engines": {
142
- "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
142
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
143
143
  },
144
144
  "release": {
145
145
  "branches": [
@@ -163,5 +163,5 @@
163
163
  "@typescript-eslint/experimental-utils": "^5.0.0",
164
164
  "fsevents/node-gyp": "^7.0.0"
165
165
  },
166
- "packageManager": "yarn@3.1.1"
166
+ "packageManager": "yarn@3.2.0"
167
167
  }