Skip to content

remove unused @testing-library/jest-dom dependency - #2517

Merged
grzanka merged 1 commit into
masterfrom
2505-remove-unused-testing-libraryjest-dom-dependency
Nov 12, 2026
Merged

grzanka merged 1 commit into
masterfrom
2505-remove-unused-testing-libraryjest-dom-dependency

Conversation

@martastn

Copy link
Copy Markdown
Contributor

Closes #2505. Part of #2481.

@testing-library/jest-dom came with the Create React App template. src/setupTests.ts only 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 template src/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, plus jest-matcher-deep-close-to registered in Units.test.ts.

Changes

  • npm uninstall @testing-library/jest-dom (jest-dom and its 7 exclusive dependencies leave the lockfile; @testing-library/dom stays, because @testing-library/react and @testing-library/user-event still need it)
  • delete src/setupTests.ts
  • drop setupTests\.ts from the dependency-cruiser doNotFollow regex

Documentation

Verified against master

  • production, demo and plg builds are byte-identical to master (129/129 files, incl. source maps)
  • Docker image: all 130 files served by nginx are byte-identical to master's image
  • tsc, ESLint, Prettier and unit tests give the same results as master (same 28 tests; ESLint differs only by the deleted file, which had no warnings)
  • dependency-cruiser: the high-level graph is identical; the low-level graph only loses the isolated setupTests.ts node
  • E2E tests give the same results as master
  • full run through the app against a local backend, in light and dark mode (login, examples, editor, project save, converter, SHIELD-HIT12A simulation, results with charts and tables, downloads, logout): same results, network requests and console as master

@martastn martastn self-assigned this Nov 11, 2026
@martastn martastn linked an issue Nov 11, 2026 that may be closed by this pull request
@grzanka
grzanka requested a balanced review from Copilot November 12, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-dom from package.json and prune it (and exclusive transitive deps) from package-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
grzanka added this pull request to the merge queue Nov 12, 2026
Merged via the queue into master with commit 6552a29 Nov 12, 2026
11 checks passed
@grzanka
grzanka deleted the 2505-remove-unused-testing-libraryjest-dom-dependency branch November 12, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unused @testing-library/jest-dom dependency

3 participants