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: add defaultIgnore config option #1138

Merged
merged 1 commit into from Jun 20, 2022

Conversation

robin-drexler
Copy link
Contributor

@robin-drexler robin-drexler commented Jun 15, 2022

What:

Adds defaultIgnore config option for byText in a similar vein to what already exists with defaultHidden for byRole.

Why:
Allows to set a default ignore globally for a project.

How:
Adds new config option. Also uses potentially overridden config value in places where the the default const was used before as this seemed to make sense to me.

Is this a change you'd be willing to accept?
If yes, I'd be happy to add docs etc. Thanks! :)

Checklist:

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 15, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 83a9db2:

Sandbox Source
react-testing-library-examples Configuration

@robin-drexler robin-drexler marked this pull request as ready for review June 15, 2022 00:34
@robin-drexler robin-drexler changed the title add defaultIgnore config option add defaultIgnore config option for byText Jun 15, 2022
eps1lon
eps1lon previously approved these changes Jun 15, 2022
Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks. This was planned as a follow-up but I didn't have time.

Could you make a PR to the docs as well?

@codecov
Copy link

codecov bot commented Jun 15, 2022

Codecov Report

Merging #1138 (83a9db2) into main (11fc773) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #1138   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        24    -1     
  Lines          985       985           
  Branches       320       321    +1     
=========================================
  Hits           985       985           
Flag Coverage Δ
node-12 100.00% <100.00%> (ø)
node-14 100.00% <100.00%> (ø)
node-16 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/config.ts 100.00% <ø> (ø)
src/pretty-dom.js 100.00% <100.00%> (ø)
src/queries/text.ts 100.00% <100.00%> (ø)
src/suggestions.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11fc773...83a9db2. Read the comment docs.

timdeschryver
timdeschryver previously approved these changes Jun 15, 2022
types/config.d.ts Show resolved Hide resolved
@robin-drexler
Copy link
Contributor Author

Thanks. This was planned as a follow-up but I didn't have time.

Could you make a PR to the docs as well?

Opened the PR here: testing-library/testing-library-docs#1088

not sure about how to release and in what order. 😅

Is that something the maintainers will do?

Thanks again!

@timdeschryver
Copy link
Member

@robin-drexler You don't have to worry about that. Thanks in advance to create both PRs!

Is that something the maintainers will do?

@robin-drexler
Copy link
Contributor Author

@robin-drexler You don't have to worry about that. Thanks in advance to create both PRs!

Is that something the maintainers will do?

Perfect, thanks a lot!
Looking forward to seeing it land. :D

Let me know if I can do anything to support.

@eps1lon
Copy link
Member

eps1lon commented Jun 16, 2022

not sure about how to release and in what order. sweat_smile

I just click two buttons and change the order every so often 😅

@eps1lon eps1lon changed the title add defaultIgnore config option for byText feat(ByText): add defaultIgnore config option Jun 16, 2022
@eps1lon eps1lon changed the title feat(ByText): add defaultIgnore config option feat: add defaultIgnore config option Jun 16, 2022
@eps1lon eps1lon added the enhancement New feature or request label Jun 20, 2022
@eps1lon eps1lon merged commit 4e9484a into testing-library:main Jun 20, 2022
@eps1lon
Copy link
Member

eps1lon commented Jun 20, 2022

@all-contributors add @robin-drexler for code

@allcontributors
Copy link
Contributor

@eps1lon

I've put up a pull request to add @robin-drexler! 🎉

@github-actions
Copy link

🎉 This PR is included in version 8.14.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
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants