-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FAQ: migrate to jest 27/testing-library >=11 #16949
Comments
(EDIT: now added to main description) We can't use TS 3.9 because (short version) it will cause massive bundle size increases for consumers. The issue is fixed in 4.0. (Message me if you want an internal link with more details.) There was also some bug blocking 3.8, though unfortunately I don't remember what that was. On initial investigation, bumping jest to 25 is likely to be doable apart from a TS upgrade, and desirable because I think it will unblock testing with react 17. Not sure how much that helps with testing-library (and definitely the goal is to get to jest 26 soon!). |
@Hotell Should we close this now or repurpose to help track jest updates? |
let's keep it open, thx. |
Updated the description and title with current status--basically it's all unblocked now (at least from a typescript perspective) but nobody has had time to do it 😞 |
Main purpose of this issue is to track issues related to jest/typescript/testing tools used.
Take this as main go to document, for person/team which is gonna tackle migration to jest26/latest testing library/typescript 4
Current state (August 2021):
Versions used within our monorepo:
I wanna bump
testing-library/react
to v11Now unblocked since we're using typescript 4.1 (>= 3.8), but not scheduled
Previous details:
@testing-library/react
v11 has as direct dependency on@testing-library/dom
version>=7.22.4
:@testing-library/dom
, starting version7.22.4
, has direct dependency onpretty-format 26.x
type
syntax (thus making TSC explode as it parses unknown language syntax)@jest/types 26.x
@jest/types 26.x
import type {} ...
)💡 NOTE:
As a consequence of
@testing-library/react
using dangerous^
for itsdom
dependency, we need to explicitly anchor it by ourselves via yarn resolution field to version ->@testing-library/dom": "7.22.3"
✅ done!
I wanna bumptypescript
to 3.9.x/4.1.xthis is done, expand for old notes
Upgrades to 3.8 and 3.9 were blocked by major bugs, which are fixed as of 4.0.More details of what will be involved in the typescript 4 upgrade are in #16101. Unfinished draft PR at #16449.
Why:
export {}
in all ambiguous module output TypeScript#38696 - fixed in 4.0I wanna bump
jest
to 27Now unblocked since we're using typescript 4.1 (>= 3.8), but not scheduled.
Tracked by #18442
Why:
Jest 26 usesexport type
which requires TS 3.8+.On initial investigation, Jest 25 doesn't have these typing issues (at least withskipLibCheck
). Though when upgrading related dependencies you have to be careful to avoid installing anything that pulls in Jest 26-series packages.Jest 25+ (more specifically its version of jsdom) appears to be required for running tests against React 17.
Related release notes:
The text was updated successfully, but these errors were encountered: