Repository navigation
remove unused @testing-library/jest-dom dependency - #2517
Merged
grzanka merged 1 commit intoNov 12, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟢 Approval recommended
The change is a straightforward cleanup that removes an unused testing-library dependency and its now-redundant setup/config references, with no remaining files or configurations indicating active issues to resolve.
No open issues 🎉
What changed in this PR
Removes the unused Create React App boilerplate @testing-library/jest-dom and its redundant Jest setup file to reduce dependency surface and maintenance churn.
Changes:
- Remove
@testing-library/jest-domfrompackage.jsonand prune it (and exclusive transitive deps) frompackage-lock.json. - Delete
src/setupTests.ts(previously only registered jest-dom matchers). - Update dependency-cruiser config to stop excluding
setupTests.ts(since it no longer exists).
| File | Description |
|---|---|
| src/setupTests.ts | Deletes the Jest setup file that only imported and registered @testing-library/jest-dom matchers. |
| package.json | Removes @testing-library/jest-dom from the project's dependencies. |
| package-lock.json | Prunes @testing-library/jest-dom and its now-unused transitive dependencies from the lockfile. |
| dependency-cruiser/depcruise-config-high-level.js | Updates the doNotFollow configuration to remove the setupTests.ts exclusion. |
Review effort: Balanced
grzanka
approved these changes
Nov 12, 2026
grzanka
deleted the
2505-remove-unused-testing-libraryjest-dom-dependency
branch
November 12, 2026 13:23
DariuszRozmus
pushed a commit
that referenced
this pull request
Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2505. Part of #2481.
@testing-library/jest-domcame with the Create React App template.src/setupTests.tsonly registers its matchers (the file contains nothing else), but no test uses any of them (toBeInTheDocument,toHaveTextContent, etc.). The only test that ever did, the templatesrc/App.test.tsx, had its assertions commented out a week after the project was created and was deleted in #951. The tests use Jest's built-in matchers, plusjest-matcher-deep-close-toregistered inUnits.test.ts.Changes
npm uninstall @testing-library/jest-dom(jest-dom and its 7 exclusive dependencies leave the lockfile;@testing-library/domstays, because@testing-library/reactand@testing-library/user-eventstill need it)src/setupTests.tssetupTests\.tsfrom the dependency-cruiserdoNotFollowregexDocumentation
setupTests.tsand jest-dom in the frontend testing page; updated in Remove setup tests.ts and jest dom from frontend testing docs for_developers#109Verified against master
setupTests.tsnode