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

fix: escape special chars in regex for toHaveTextContent fixer #68

Merged
merged 1 commit into from
Aug 3, 2020
Merged

fix: escape special chars in regex for toHaveTextContent fixer #68

merged 1 commit into from
Aug 3, 2020

Conversation

skovy
Copy link
Contributor

@skovy skovy commented Aug 3, 2020

What:

  • Escape (RegExp) special characters in strings that are treated as regular expressions in the fixer for toHaveTextContent.
  • Convert non-strings (eg: 100) to a string before converting to a RegExp.

Why:

So the fixer works out-of-the-box without any additional manual fixes.

How:

Checklist:

  • Documentation (N/A)
  • Tests
  • Ready to be merged

@codecov
Copy link

codecov bot commented Aug 3, 2020

Codecov Report

Merging #68 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #68   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          138       138           
  Branches        21        21           
=========================================
  Hits           138       138           
Impacted Files Coverage Δ
src/rules/prefer-to-have-text-content.js 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 875e6b1...32906ff. Read the comment docs.

@benmonro
Copy link
Member

benmonro commented Aug 3, 2020

very nice, thank you!

@benmonro
Copy link
Member

benmonro commented Aug 3, 2020

@all-contributors please add @skovy for code and tests.

@allcontributors
Copy link
Contributor

@benmonro

I've put up a pull request to add @skovy! 🎉

@benmonro benmonro merged commit b0a252d into testing-library:master Aug 3, 2020
@benmonro
Copy link
Member

benmonro commented Aug 3, 2020

🎉 This PR is included in version 3.1.5 🎉

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