Skip to content

Commit

Permalink
jest: Update all Jest-related dependencies to their latest.
Browse files Browse the repository at this point in the history
In particular, this gets us Jest 26.4.1, which contains
jestjs/jest#10414. This should fix an issue [1] we'd otherwise
encounter very soon, where differences in a URL object encountered
with `expect(...).toBe(...)` or `expect(...).toEqual(...)` would
result in a very cryptic error message instead of a straightforward
test failure with the desired explanation.

This upgrade was pretty easy to do! I'm hoping fb23341 has
increased the ease of staying up-to-date with Jest.

Since we're going from a 22.x to 23.x of eslint-plugin-jest, we
check the declared breaking changes at 23.0.0 [2]. The only one that
concerns us is that part of the job of `jest/valid-describe` has
been transferred to `jest/valid-title`, and `jest/valid-title` has
been added to the `jest/recommended` config, which we take. The
validation in question is silly, and unfortunately, we can't
reasonably take all of `jest/valid-title` except that part, so, turn
it all off.

See also some prep work for this upgrade in a recent commit.

[1] jestjs/jest#10408
[2] https://github.com/jest-community/eslint-plugin-jest/releases/tag/v23.0.0
  • Loading branch information
chrisbobbe committed Aug 21, 2020
1 parent d20f961 commit f363f84
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 107 deletions.
15 changes: 12 additions & 3 deletions .eslintrc.yaml
Expand Up @@ -165,9 +165,18 @@ rules:
# don't have a way to do that, and it doesn't make sense to keep these
# out of the repo.
jest/no-disabled-tests: off
# Only using string literals for test names isn't obviously helpful;
# see jest-community/eslint-plugin-jest#203 (rule might be removed?)
jest/valid-describe: off

# Only using string literals for test names, under the heading
# `titleMustBeString`, [1] is silly and should probably not be a
# thing [2]. We wish we could get all of this rule except that part.
# In fact, it's possible to ignore it *for describe blocks
# only* [3], but there are no plans to allow turning it off for
# `test` blocks.
#
# [1] https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/valid-title.md
# [2] https://github.com/jest-community/eslint-plugin-jest/issues/203.
# [3] https://github.com/jest-community/eslint-plugin-jest/issues/470
jest/valid-title: off

# React
react/jsx-filename-extension: off # Like RN upstream, we call the files *.js.
Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -97,7 +97,7 @@
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.3",
"@babel/runtime": "^7.6.2",
"@jest/source-map": "^26.1.0",
"@jest/source-map": "^26.3.0",
"babel-eslint": "^10.0.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"deep-freeze": "^0.0.1",
Expand All @@ -106,16 +106,16 @@
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-flowtype": "^4.7.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^22.21.0",
"eslint-plugin-jest": "^23.20.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.5",
"flow-bin": "^0.105.0",
"flow-coverage-report": "^0.6.0",
"flow-typed": "^2.4.0",
"jest": "^26.1.0",
"jest-cli": "^26.1.0",
"jest-environment-jsdom": "^26.1.0",
"jest": "^26.4.1",
"jest-cli": "^26.4.1",
"jest-environment-jsdom": "^26.3.0",
"jest-environment-jsdom-global": "^2.0.4",
"jest-extended": "^0.11.5",
"jetifier": "^1.6.5",
Expand Down

0 comments on commit f363f84

Please sign in to comment.