Skip to content

Commit

Permalink
⬆️ Upgrade to eslint-plugin-jest 21.24.1
Browse files Browse the repository at this point in the history
- New rule: `jest/expect-expect` defaults to `off` for now, as we are unable to configure it to recognize `td.verify` as an assertion method.  See jest-community/eslint-plugin-jest#175.
- New rule: `jest/no-alias-methods` defaults to `off` because we prefer `toThrowError` over `toThrow` and there's no way to configure the rule to allow some aliases but not all.
- New rule: `jest/no-test-return-statement` defaults to `warn`
- New rule: `jest/prefer-inline-snapshots` defaults to `off`
- New rule: `jest/prefer-strict-equal` defaults to `warn`
- New rule: `jest/require-tothrow-message` defaults to `warn`
  • Loading branch information
randycoulman committed Oct 12, 2018
1 parent c6ee745 commit 94cb5bb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ This plugin contains all of the rules available in:
- [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react): 7.10.0
- [eslint-plugin-react-native](https://github.com/intellicode/eslint-plugin-react-native): 3.2.1
- [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import): 2.14.0
- [eslint-plugin-jest](https://www.npmjs.com/package/eslint-plugin-jest): 21.15.0
- [eslint-plugin-jest](https://www.npmjs.com/package/eslint-plugin-jest): 21.24.1

## License

Expand Down
13 changes: 13 additions & 0 deletions jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ module.exports = {
//
// Enforce consistent test or it keyword
"jest/consistent-test-it": ["warn", { fn: "test", withinDescribe: "test" }],
// Enforce assertion to be made in a test body
// Off for now, pending a resolution to https://github.com/jest-community/eslint-plugin-jest/issues/175
"jest/expect-expect": "off",
// Disallow capitalized test names
"jest/lowercase-name": "warn",
// Don't use alias methods
"jest/no-alias-methods": "off",
// Disallow disabled tests
"jest/no-disabled-tests": "warn",
// Disallow focused tests
Expand All @@ -35,14 +40,22 @@ module.exports = {
"jest/no-large-snapshots": "warn",
// Disallow using f & x prefixes to define focused/skipped tests
"jest/no-test-prefixes": "off",
// Disallow explicitly returning from tests
"jest/no-test-return-statement": "warn",
// Suggest using expect.assertions() OR expect.hasAssertions()
"jest/prefer-expect-assertions": "off",
// Suggest using inline snapshots
"jest/prefer-inline-snapshots": "off",
// Suggest using toStrictEqual()
"jest/prefer-strict-equal": "warn",
// Suggest using toHaveLength()
"jest/prefer-to-have-length": "warn",
// Suggest using toBeNull()
"jest/prefer-to-be-null": "warn",
// Suggest using toBeUndefined()
"jest/prefer-to-be-undefined": "warn",
// Require a message for toThrow()
"jest/require-tothrow-message": "warn",
// Enforce valid describe() callback
"jest/valid-describe": "warn",
// Ensure expect is called correctly
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"eslint-config-prettier": "^3.1.0",
"eslint-find-rules": "^3.3.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jest": "21.17.0",
"eslint-plugin-jest": "21.24.1",
"eslint-plugin-react": "7.10.0",
"eslint-plugin-react-native": "3.2.1",
"husky": "^1.1.2",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,9 @@ eslint-plugin-import@2.14.0:
read-pkg-up "^2.0.0"
resolve "^1.6.0"

eslint-plugin-jest@21.17.0:
version "21.17.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.17.0.tgz#fdb00e2f9ff16987d6ebcf2c75c7add105760bbb"
eslint-plugin-jest@21.24.1:
version "21.24.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.24.1.tgz#aaf3c34e816f07add83d1e9c20696fdc31fac8dc"

eslint-plugin-react-native-globals@^0.1.1:
version "0.1.2"
Expand Down

0 comments on commit 94cb5bb

Please # to comment.