-
Notifications
You must be signed in to change notification settings - Fork 191
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
chore: use mocked from jest-mock in tests #1340
Conversation
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.
Tested: does what it says on the tin, nice one.
I'll leave it to your discretion after you speak with @cjthompson about whether we should kill the ts-jest
dependency, or if it's needed for jest tests in some way we haven't thought of - comment your learnings before merging 👌
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 @0xf11nix! Tested locally and this removes the log spew.
As @0xApotheosis mentioned, it looks like ts-jest
dependency should be able to go away. It's not used anywhere, isn't even present in yarn.lock
as a transient dependency of any package, and yarn local-ci
runs without any issue without it but please double-check before we merge this.
Thank you for you reviews @0xApotheosis and @gomesalexandre. Yes, The removal of While this dependency has been in the codebase since initial commit, and its (now) deprecated test helpers have only actually been referenced in tests since #606, I do think it's probably reasonable to remove it. There is still seems to be some uncertainty about where (if anywhere) Short term? Well, yes. -ish. I would expect that there will be somewhat of a backoff in risk as TS support in both core Jest and the Babel transpiler improves. Until then, we'll kind of just need to keep an eye on it. Bonus: One less "unmet peer dependency" warning on install |
Deploying with Cloudflare Pages
|
Thanks for the detailed comment! Agreed, the risk is very low compared to having an unused dependency in |
Description
This PR migrates the deprecated
mocked
test helper fromts-jest/utils
to the suggested replacement fromjest-mock
in order to fix the large number of deprecation warnings, etc, being generated when runningyarn test
.Most of the output refers to a single deprecation warning.
Documentation related to the source of this warning can be found in the ts-jest guides
I have added
jest-mock
as a devDependency inpackage.json
, but since it is already a dependency of a number of existing packages, it does not actually result in changes to the yarn.lock file.Notice
Pull Request Type
Issue (if applicable)
Closes #1293
Risk
There is some potential risk of regression in the testing environment, though all existing test are passing, so I would expect this risk to be fairly low at this point in time.
Since this is a dev/test dependency only, the possibility of this change affecting the production environment seems highly unlikely.
Testing
run
yarn test
and observe the lack of rank spew (example in screenshot below)Screenshots (if applicable)