eslint-plugin-jest 26.1.1 → 26.1.2
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.
|
@@ -14,10 +14,26 @@ const isSnapshotMatcher = matcher => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const isSnapshotMatcherWithoutHint = matcher => {
|
|
17
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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.
|
|
3
|
+
"version": "26.1.2",
|
|
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": "^
|
|
121
|
+
"pinst": "^3.0.0",
|
|
122
122
|
"prettier": "^2.0.5",
|
|
123
123
|
"rimraf": "^3.0.0",
|
|
124
124
|
"semantic-release": "^19.0.0",
|
|
@@ -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.
|
|
166
|
+
"packageManager": "yarn@3.2.0"
|
|
167
167
|
}
|