Skip to content

Commit

Permalink
fix(deps): update dependency eslint-plugin-jest to v27.2.0
Browse files Browse the repository at this point in the history
- add `jest/no-untyped-mock-factory` rule
  • Loading branch information
ljosberinn committed Jan 6, 2023
1 parent 1bfe9e2 commit 2b0e074
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Beginning with `eslint-config-galex` `v4.2.2` or newer, until this disclaimer is
- `"eslint-plugin-jest": "27.1.5"`

```sh
npm i --save-dev eslint-plugin-jest@27.1.5
npm i --save-dev eslint-plugin-jest@27.2.0

yarn add -D eslint-plugin-jest@27.1.5
yarn add -D eslint-plugin-jest@27.2.0
```

</details>
Expand Down
5 changes: 5 additions & 0 deletions __tests__/overrides/__snapshots__/jest.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ exports[`createJestRules default 1`] = `
"jest/no-test-return-statement": "error",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/no-untyped-mock-factory": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
Expand Down Expand Up @@ -148,6 +149,7 @@ exports[`createJestRules with create-react-app 1`] = `
"jest/no-test-return-statement": "error",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/no-untyped-mock-factory": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
Expand Down Expand Up @@ -244,6 +246,7 @@ exports[`createJestRules with typescript 1`] = `
"jest/no-test-return-statement": "error",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/no-untyped-mock-factory": "warn",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
Expand Down Expand Up @@ -476,6 +479,7 @@ exports[`override snapshots with jest-dom 1`] = `
"jest/no-test-return-statement": "error",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/no-untyped-mock-factory": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
Expand Down Expand Up @@ -570,6 +574,7 @@ exports[`override snapshots with testing-lib 1`] = `
"jest/no-test-return-statement": "error",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/no-untyped-mock-factory": "off",
"jest/prefer-called-with": "error",
"jest/prefer-comparison-matcher": "warn",
"jest/prefer-each": "warn",
Expand Down
1 change: 1 addition & 0 deletions integration/cra-js/eslint-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@
"jest/no-standalone-expect": "off",
"jest/no-test-prefixes": "error",
"jest/no-test-return-statement": "error",
"jest/no-untyped-mock-factory": "off",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
Expand Down
1 change: 1 addition & 0 deletions integration/cra-ts/eslint-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
"jest/no-standalone-expect": "off",
"jest/no-test-prefixes": "error",
"jest/no-test-return-statement": "error",
"jest/no-untyped-mock-factory": "warn",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
Expand Down
2 changes: 1 addition & 1 deletion integration/cra-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"web-vitals": "^2.1.0"
},
"devDependencies": {
"eslint-plugin-jest": "27.0.1"
"eslint-plugin-jest": "27.2.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
8 changes: 4 additions & 4 deletions integration/cra-ts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4042,10 +4042,10 @@ eslint-plugin-import@^2.25.3:
resolve "^1.22.0"
tsconfig-paths "^3.14.1"

eslint-plugin-jest@27.0.1:
version "27.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.0.1.tgz#3e67ee2051411540988c62075e8788702a1064da"
integrity sha512-LosUsrkwVSs/8Z/I8Hqn5vWgTEsHrfIquDEKOsV8/cl+gbFR4tiRCE1AimEotsHjSC0Rx1tYm6vPhw8C3ktmmg==
eslint-plugin-jest@27.2.0:
version "27.2.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.2.0.tgz#8e9976705642bea1981596c0ba5e3f46d449f3fc"
integrity sha512-KGIYtelk4rIhKocxRKUEeX+kJ0ZCab/CiSgS8BMcKD7AY7YxXhlg/d51oF5jq2rOrtuJEDYWRwXD95l6l2vtrA==
dependencies:
"@typescript-eslint/utils" "^5.10.0"

Expand Down
1 change: 1 addition & 0 deletions integration/jest/eslint-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"jest/no-standalone-expect": "off",
"jest/no-test-prefixes": "error",
"jest/no-test-return-statement": "error",
"jest/no-untyped-mock-factory": "warn",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
Expand Down
1 change: 1 addition & 0 deletions integration/nest-ts/eslint-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
"jest/no-standalone-expect": "off",
"jest/no-test-prefixes": "error",
"jest/no-test-return-statement": "error",
"jest/no-untyped-mock-factory": "warn",
"jest/no-truthy-falsy": "off",
"jest/no-try-expect": "off",
"jest/prefer-called-with": "error",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"eslint-import-resolver-typescript": "3.5.2",
"eslint-plugin-etc": "2.0.2",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "27.1.5",
"eslint-plugin-jest": "27.2.0",
"eslint-plugin-jest-dom": "4.0.3",
"eslint-plugin-jest-formatting": "3.1.0",
"eslint-plugin-jsx-a11y": "6.6.1",
Expand Down
7 changes: 7 additions & 0 deletions src/overrides/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@ export const createJestRules: RulesCreator = ({
*/
'jest/no-test-return-statement': 'error',

/**
* disallows using jest.mock without passing a type
*
* @see https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/no-untyped-mock-factory.md
*/
'jest/no-untyped-mock-factory': hasTypeScript ? 'warn' : 'off',

/**
* off because superseded in favor of `jest/no-restricted-matchers`
*
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2788,10 +2788,10 @@ eslint-plugin-jest-formatting@3.1.0:
resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.1.0.tgz#b26dd5a40f432b642dcc880021a771bb1c93dcd2"
integrity sha512-XyysraZ1JSgGbLSDxjj5HzKKh0glgWf+7CkqxbTqb7zEhW7X2WHo5SBQ8cGhnszKN+2Lj3/oevBlHNbHezoc/A==

eslint-plugin-jest@27.1.5:
version "27.1.5"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.1.5.tgz#16fad619cfee6cdf73d56098fbed0761e1f653ce"
integrity sha512-CK2dekZ5VBdzsOSOH5Fc1rwC+cWXjkcyrmf1RV714nDUDKu+o73TTJiDxpbILG8PtPPpAAl3ywzh5QA7Ft0mjA==
eslint-plugin-jest@27.2.0:
version "27.2.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.2.0.tgz#8e9976705642bea1981596c0ba5e3f46d449f3fc"
integrity sha512-KGIYtelk4rIhKocxRKUEeX+kJ0ZCab/CiSgS8BMcKD7AY7YxXhlg/d51oF5jq2rOrtuJEDYWRwXD95l6l2vtrA==
dependencies:
"@typescript-eslint/utils" "^5.10.0"

Expand Down

0 comments on commit 2b0e074

Please sign in to comment.