-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(react): react-router should work with jest out of the box #30487
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
281a10e
to
a727025
Compare
View your CI Pipeline Execution ↗ for commit dadb3a7.
☁️ Nx Cloud last updated this comment at |
View your CI Pipeline Execution ↗ for commit a727025. ☁️ Nx Cloud last updated this comment at |
e99d008
to
9762522
Compare
9762522
to
37cc2cc
Compare
packages/jest/src/generators/configuration/files/common/tsconfig.spec.json__tmpl__
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- add an e2e that runs typecheck
- In the e2e that is checking that the tests pass, also check that the number of passing test suites matches the expected number
37cc2cc
to
7f13ad4
Compare
7f13ad4
to
7e2bd81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I left a couple of recommendations to reduce some overhead in the e2e tests.
7e2bd81
to
59907f3
Compare
59907f3
to
dadb3a7
Compare
Jest should be compatible with react-router out of the box.
Current Behavior
Currently, there are two issues when using
jest
with react-router out of the boxtsconfig
jsdom
is missing Node'sTextEncoder
andTextDecoder
so compilation fails.Expected Behavior
Running a test should work without issues when you create a react-router app with Jest.
Related Issue(s)
Fixes #30387