Skip to content

Commit b12d9f2

Browse files
committed
jest: Update all Jest-related dependencies to their latest.
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
1 parent 3bdca58 commit b12d9f2

File tree

3 files changed

+139
-107
lines changed

3 files changed

+139
-107
lines changed

.eslintrc.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,18 @@ rules:
165165
# don't have a way to do that, and it doesn't make sense to keep these
166166
# out of the repo.
167167
jest/no-disabled-tests: off
168-
# Only using string literals for test names isn't obviously helpful;
169-
# see jest-community/eslint-plugin-jest#203 (rule might be removed?)
170-
jest/valid-describe: off
168+
169+
# Only using string literals for test names, under the heading
170+
# `titleMustBeString`, [1] is silly and should probably not be a
171+
# thing [2]. We wish we could get all of this rule except that part.
172+
# In fact, it's possible to ignore it *for describe blocks
173+
# only* [3], but there are no plans to allow turning it off for
174+
# `test` blocks.
175+
#
176+
# [1] https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/valid-title.md
177+
# [2] https://github.com/jest-community/eslint-plugin-jest/issues/203.
178+
# [3] https://github.com/jest-community/eslint-plugin-jest/issues/470
179+
jest/valid-title: off
171180

172181
# The docs for this rule [1] say that placing an `expect` call
173182
# outside a `test` or `it` block (e.g., in a `beforeEach` or

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"@babel/core": "^7.11.4",
103103
"@babel/preset-env": "^7.11.0",
104104
"@babel/runtime": "^7.6.2",
105-
"@jest/source-map": "^26.1.0",
105+
"@jest/source-map": "^26.3.0",
106106
"@rollup/plugin-babel": "^5.2.0",
107107
"@rollup/plugin-node-resolve": "^9.0.0",
108108
"babel-eslint": "^10.0.3",
@@ -114,17 +114,17 @@
114114
"eslint-config-prettier": "^6.11.0",
115115
"eslint-plugin-flowtype": "^4.7.0",
116116
"eslint-plugin-import": "^2.22.0",
117-
"eslint-plugin-jest": "^22.21.0",
117+
"eslint-plugin-jest": "^23.20.0",
118118
"eslint-plugin-jsx-a11y": "^6.3.1",
119119
"eslint-plugin-prettier": "^3.1.4",
120120
"eslint-plugin-react": "^7.20.5",
121121
"eslint-plugin-react-hooks": "^4.0.8",
122122
"flow-bin": "^0.105.0",
123123
"flow-coverage-report": "^0.6.0",
124124
"flow-typed": "^2.4.0",
125-
"jest": "^26.1.0",
126-
"jest-cli": "^26.1.0",
127-
"jest-environment-jsdom": "^26.1.0",
125+
"jest": "^26.4.1",
126+
"jest-cli": "^26.4.1",
127+
"jest-environment-jsdom": "^26.3.0",
128128
"jest-environment-jsdom-global": "^2.0.4",
129129
"jest-extended": "^0.11.5",
130130
"jetifier": "^1.6.5",

0 commit comments

Comments
 (0)