-
Notifications
You must be signed in to change notification settings - Fork 403
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
Types breakage in v6.4.0 #574
Comments
Hi @Rugvip! I am not a maintainer, but I am the person that contributed Two quick checksCan I ask you to check two things on your end?
Since the core export of the package is the matchers, there is no need to separately export the You can use patch-package, pnpm's native patching, or even the code editor in a pinch, whichever you prefer. I ask you, because I tried to reproduce this issue in our codebase at work, and we are not getting this issue. Tests type-check both with and without the change in option 1 above. TypeScript config is vast, so I'm not drawing any conclusions yet 😅 Some more context on the fixes
This would probably not be enough. For example, the type tests in this repository fail with that change. You can run the type tests in the repository via I tried copying over your Future testingI have a gut feeling that the type tests in this repository are missing some use-cases (perhaps config combinations), if they can break like this. I don't have a concrete suggestion for it right now; maybe the maintainers have run into this before? |
@fpapado Thank you for the reply! 🎉
I played around with the types a bit in this repo. I didn't find any instructions for how to check types, but I've been running I moved over to reproducing in a minimal Backstage setup instead: npx @backstage/create-app@latest --skip-install # "repro-jest-dom" as app name
cd repro-jest-dom
yarn install
yarn tsc:full # error In that setup I could verify that removing the |
Thanks for checking, @Rugvip! I opened a PR for the maintainers to consider, but I do not have a good test case to add to the repo. So I leave it up to them, how to proceed. I opened the PR mostly to account for any timezone differences, not because it is the end-all-be-all solution :)
Did you try running the type tests with CleanShot.2024-01-30.at.21.10.03.mp4 |
@fpapado yep those do catch the |
Aha! I believe it is
By switching it off, or by running tsc directly on the However, when changing this, there is a cascade of other errors that show up. I do not know which ones are valid, because the type overloading / declaration merging in this library seems complex. This leads me to think that Incidentally, at work, we also have CleanShot.2024-01-31.at.08.57.58.mp4 |
FYI, using skipLibCheck will cause type-errors to silently result in |
I tried it in our setup, and the fix works. Thank you! |
Works for us too, thank you! 👍 |
We're seeing an issue with the types in the latest release (v6.4.0). In particular the addition of the
ByRoleMatcher
type declaration breaks the export assignment later on, resulting in the following error:@testing-library/jest-dom
version: v6.4.0node
version: n/ajest
(orvitest
) version: n/anpm
(oryarn
) version: n/aRelevant code or config:
tsconfig.json
What you did:
Example breakage in a CI run here: https://github.com/backstage/backstage/actions/runs/7708717042/job/21008397598?pr=22596
What happened:
Reproduction:
Doesn't seem to reproduce in codesandbox, may be related to TypeScript version or config?
Problem description:
Breaks TypeScript type checks.
Suggested solution:
Might be enough to switch the re-export to
export { matchers }
?The text was updated successfully, but these errors were encountered: