eslint-plugin-jest 26.1.3 → 26.1.4

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.
@@ -59,6 +59,7 @@ var _default = (0, _utils.createRule)({
59
59
 
60
60
  create(context, [mode]) {
61
61
  const snapshotMatchers = [];
62
+ const depths = [];
62
63
  let expressionDepth = 0;
63
64
 
64
65
  const reportSnapshotMatchersWithoutHints = () => {
@@ -104,7 +105,21 @@ var _default = (0, _utils.createRule)({
104
105
  ArrowFunctionExpression: enterExpression,
105
106
  'ArrowFunctionExpression:exit': exitExpression,
106
107
 
108
+ 'CallExpression:exit'(node) {
109
+ if ((0, _utils.isDescribeCall)(node) || (0, _utils.isTestCaseCall)(node)) {
110
+ var _depths$pop;
111
+
112
+ /* istanbul ignore next */
113
+ expressionDepth = (_depths$pop = depths.pop()) !== null && _depths$pop !== void 0 ? _depths$pop : 0;
114
+ }
115
+ },
116
+
107
117
  CallExpression(node) {
118
+ if ((0, _utils.isDescribeCall)(node) || (0, _utils.isTestCaseCall)(node)) {
119
+ depths.push(expressionDepth);
120
+ expressionDepth = 0;
121
+ }
122
+
108
123
  if (!(0, _utils.isExpectCall)(node)) {
109
124
  return;
110
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-jest",
3
- "version": "26.1.3",
3
+ "version": "26.1.4",
4
4
  "description": "ESLint rules for Jest",
5
5
  "keywords": [
6
6
  "eslint",
@@ -112,7 +112,7 @@
112
112
  "eslint-plugin-node": "^11.0.0",
113
113
  "eslint-plugin-prettier": "^3.4.1",
114
114
  "eslint-remote-tester": "^2.1.0",
115
- "eslint-remote-tester-repositories": "^0.0.4",
115
+ "eslint-remote-tester-repositories": "^0.0.5",
116
116
  "husky": "^7.0.2",
117
117
  "is-ci": "^3.0.0",
118
118
  "jest": "^27.0.0",