Skip to content
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

feat: make @testing-library/dom dependency optional #319

Merged
merged 3 commits into from
Aug 26, 2023

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Aug 26, 2023

What:

Makes our dependency on @testing-library/dom optional.

Why:

@testing-library/dom is a sizable dependency to pull in just for the name of the queries which are a pretty static thing, and it is possible to use jest-dom without @testing-library; it also conflicts with Yarn PnP when using a more specific variant as it's recommended to not have @testing-library/dom as a dependency in that case.

How:

Using the same logic to what we do in eslint-plugin-jest for extending @typescript-eslint/eslint-plugin rules - in this case, we have a default list of queries we expect to exist which we use if we're not able to get a more up-to-date list via requiring @testing-library/dom.

Note that I have purposely not added support for checking for more specific variants as part of this change; I plan to do that as a follow-up once this has been landed.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@codecov
Copy link

codecov bot commented Aug 26, 2023

Codecov Report

Merging #319 (f59aa34) into main (a7ee93c) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #319   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines          602       611    +9     
  Branches       172       173    +1     
=========================================
+ Hits           602       611    +9     
Files Changed Coverage Δ
src/queries.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@G-Rath G-Rath enabled auto-merge (squash) August 26, 2023 01:22
@G-Rath G-Rath merged commit 88e8bb0 into main Aug 26, 2023
62 checks passed
@G-Rath G-Rath deleted the make-dom-dependency-optional branch August 26, 2023 01:23
@github-actions
Copy link

🎉 This PR is included in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants