-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PM-16917] Remove jest-extended dependency #12798
Conversation
New Issues (3)Checkmarx found the following issues in this Pull Request
Fixed Issues (1)Great job! The following issues were fixed in this Pull Request
|
This is essentially approved. I'll revisit it once the pipeline passes. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #12798 +/- ##
=======================================
Coverage 34.28% 34.28%
=======================================
Files 2935 2935
Lines 90229 90229
Branches 16943 16943
=======================================
Hits 30937 30937
Misses 56828 56828
Partials 2464 2464 ☔ View full report in Codecov by Sentry. |
I've fixed the failing tests, there were a few places that were still using I also had to tweak the matcher itself to not use a generic signature as this is not supported by the jest type package. EDIT: I've also added more helpful error messages for the positive & negative ( |
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-16917
📔 Objective
@Hinton requested that we reconsider whether we need the
jest-extended
dependency.We only use 2 matchers from it:
tobeTrue()
- trivially rewritten asexpect().toBe(true)
.toIncludeAllPartialMembers
- this checks that all the expected objects appear in the array using a partial match (e.g.objectContaining
). This is useful but was easy enough to implement our own version of.I have made these changes and removed
jest-extended
.Unfortunately I did need to add
jest-diff
to present a readable error message if the custom matcher fails. However, this is already used by jest so it's not net new. Also, it's officially maintained by jest rather than the community. So overall I still think this is an improvement.I made SM Team the owner of
jest-diff
for renovate purposes, just to keep it grouped with the existing configuration for jest packages.📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes