eslint-plugin-jest 28.0.0-next.5 → 28.0.0-next.6

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.
@@ -25,10 +25,10 @@ const reportOnViolation = (context, node, {
25
25
  if (allowedSnapshotsInFile) {
26
26
  const snapshotName = (0, _utils2.getAccessorValue)(node.expression.left.property);
27
27
  isAllowed = allowedSnapshotsInFile.some(name => {
28
- if (name instanceof RegExp) {
29
- return name.test(snapshotName);
28
+ if (typeof name === 'string') {
29
+ return snapshotName === name;
30
30
  }
31
- return snapshotName === name;
31
+ return name.test(snapshotName);
32
32
  });
33
33
  }
34
34
  }
@@ -99,11 +99,11 @@ function getNodeName(node) {
99
99
  const isFunction = node => node.type === _utils.AST_NODE_TYPES.FunctionExpression || node.type === _utils.AST_NODE_TYPES.ArrowFunctionExpression;
100
100
  exports.isFunction = isFunction;
101
101
  const getTestCallExpressionsFromDeclaredVariables = (declaredVariables, context) => {
102
- return declaredVariables.reduce((acc, {
102
+ return declaredVariables.flatMap(({
103
103
  references
104
- }) => acc.concat(references.map(({
104
+ }) => references.map(({
105
105
  identifier
106
- }) => identifier.parent).filter(node => node?.type === _utils.AST_NODE_TYPES.CallExpression && (0, _parseJestFnCall.isTypeOfJestFnCall)(node, context, ['test']))), []);
106
+ }) => identifier.parent).filter(node => node?.type === _utils.AST_NODE_TYPES.CallExpression && (0, _parseJestFnCall.isTypeOfJestFnCall)(node, context, ['test'])));
107
107
  };
108
108
 
109
109
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-jest",
3
- "version": "28.0.0-next.5",
3
+ "version": "28.0.0-next.6",
4
4
  "description": "ESLint rules for Jest",
5
5
  "keywords": [
6
6
  "eslint",