eslint-plugin-jest 26.2.2 → 26.4.1

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.
@@ -131,8 +131,9 @@ var _default = (0, _utils2.createRule)({
131
131
  var _mustNotMatchPatterns, _mustMatchPatterns$je;
132
132
 
133
133
  const scope = context.getScope();
134
+ const jestFnCall = (0, _utils2.parseJestFnCall)(node, scope);
134
135
 
135
- if (!(0, _utils2.isDescribeCall)(node, scope) && !(0, _utils2.isTestCaseCall)(node, scope)) {
136
+ if ((jestFnCall === null || jestFnCall === void 0 ? void 0 : jestFnCall.type) !== 'describe' && (jestFnCall === null || jestFnCall === void 0 ? void 0 : jestFnCall.type) !== 'test') {
136
137
  return;
137
138
  }
138
139
 
@@ -147,7 +148,7 @@ var _default = (0, _utils2.createRule)({
147
148
  return;
148
149
  }
149
150
 
150
- if (argument.type !== _utils.AST_NODE_TYPES.TemplateLiteral && !(ignoreTypeOfDescribeName && (0, _utils2.isDescribeCall)(node, scope))) {
151
+ if (argument.type !== _utils.AST_NODE_TYPES.TemplateLiteral && !(ignoreTypeOfDescribeName && jestFnCall.type === 'describe')) {
151
152
  context.report({
152
153
  messageId: 'titleMustBeString',
153
154
  loc: argument.loc
@@ -163,7 +164,7 @@ var _default = (0, _utils2.createRule)({
163
164
  context.report({
164
165
  messageId: 'emptyTitle',
165
166
  data: {
166
- jestFunctionName: (0, _utils2.isDescribeCall)(node, scope) ? _utils2.DescribeAlias.describe : _utils2.TestCaseName.test
167
+ jestFunctionName: jestFnCall.type === 'describe' ? _utils2.DescribeAlias.describe : _utils2.TestCaseName.test
167
168
  },
168
169
  node
169
170
  });
@@ -193,10 +194,10 @@ var _default = (0, _utils2.createRule)({
193
194
  });
194
195
  }
195
196
 
196
- const nodeName = trimFXprefix((0, _utils2.getNodeName)(node));
197
+ const unprefixedName = trimFXprefix(jestFnCall.name);
197
198
  const [firstWord] = title.split(' ');
198
199
 
199
- if (firstWord.toLowerCase() === nodeName) {
200
+ if (firstWord.toLowerCase() === unprefixedName) {
200
201
  context.report({
201
202
  messageId: 'duplicatePrefix',
202
203
  node: argument,
@@ -204,7 +205,7 @@ var _default = (0, _utils2.createRule)({
204
205
  });
205
206
  }
206
207
 
207
- const [jestFunctionName] = nodeName.split('.');
208
+ const jestFunctionName = unprefixedName;
208
209
  const [mustNotMatchPattern, mustNotMatchMessage] = (_mustNotMatchPatterns = mustNotMatchPatterns[jestFunctionName]) !== null && _mustNotMatchPatterns !== void 0 ? _mustNotMatchPatterns : [];
209
210
 
210
211
  if (mustNotMatchPattern) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-jest",
3
- "version": "26.2.2",
3
+ "version": "26.4.1",
4
4
  "description": "ESLint rules for Jest",
5
5
  "keywords": [
6
6
  "eslint",