eslint-plugin-jest 27.0.1 → 27.0.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.
@@ -20,13 +20,12 @@ This rule can also autofix a number of these deprecations for you.
20
20
 
21
21
  ### `jest.resetModuleRegistry`
22
22
 
23
- This function was renamed to `resetModules` in Jest 15, and is scheduled for
24
- removal in Jest 27.
23
+ This function was renamed to `resetModules` in Jest 15 and removed in Jest 27.
25
24
 
26
25
  ### `jest.addMatchers`
27
26
 
28
- This function was replaced with `expect.extend` in Jest 17, and is scheduled for
29
- removal in Jest 27.
27
+ This function was replaced with `expect.extend` in Jest 17 and removed in
28
+ Jest 27.
30
29
 
31
30
  ### `require.requireActual` & `require.requireMock`
32
31
 
@@ -41,10 +40,10 @@ the release of Jest 26 saw them removed from the `require` function altogether.
41
40
 
42
41
  ### `jest.runTimersToTime`
43
42
 
44
- This function was renamed to `advanceTimersByTime` in Jest 22, and is scheduled
45
- for removal in Jest 27.
43
+ This function was renamed to `advanceTimersByTime` in Jest 22 and removed in
44
+ Jest 27.
46
45
 
47
46
  ### `jest.genMockFromModule`
48
47
 
49
48
  This function was renamed to `createMockFromModule` in Jest 26, and is scheduled
50
- for removal in a future version of Jest.
49
+ for removal in Jest 30.
@@ -7,6 +7,14 @@ exports.default = void 0;
7
7
 
8
8
  var _utils = require("./utils");
9
9
 
10
+ const isChainRestricted = (chain, restriction) => {
11
+ if (_utils.ModifierName.hasOwnProperty(restriction) || restriction.endsWith('.not')) {
12
+ return chain.startsWith(restriction);
13
+ }
14
+
15
+ return chain === restriction;
16
+ };
17
+
10
18
  var _default = (0, _utils.createRule)({
11
19
  name: __filename,
12
20
  meta: {
@@ -41,7 +49,7 @@ var _default = (0, _utils.createRule)({
41
49
  const chain = jestFnCall.members.map(nod => (0, _utils.getAccessorValue)(nod)).join('.');
42
50
 
43
51
  for (const [restriction, message] of Object.entries(restrictedChains)) {
44
- if (chain.startsWith(restriction)) {
52
+ if (isChainRestricted(chain, restriction)) {
45
53
  context.report({
46
54
  messageId: message ? 'restrictedChainWithMessage' : 'restrictedChain',
47
55
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-jest",
3
- "version": "27.0.1",
3
+ "version": "27.0.2",
4
4
  "description": "ESLint rules for Jest",
5
5
  "keywords": [
6
6
  "eslint",
@@ -109,7 +109,7 @@
109
109
  "@semantic-release/changelog": "^6.0.0",
110
110
  "@semantic-release/git": "^10.0.0",
111
111
  "@types/dedent": "^0.7.0",
112
- "@types/jest": "^28.0.0",
112
+ "@types/jest": "^29.0.0",
113
113
  "@types/node": "^14.18.26",
114
114
  "@types/prettier": "^2.0.0",
115
115
  "@typescript-eslint/eslint-plugin": "^5.0.0",