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

Added explicit error message for null or undefined matchers #718

Merged
merged 3 commits into from
Jul 25, 2020
Merged

Added explicit error message for null or undefined matchers #718

merged 3 commits into from
Jul 25, 2020

Conversation

JoshuaKGoldberg
Copy link
Contributor

What:

Added a nice explicit error message for the case in #717 of null or undefined as a matcher.

Why:

Better error messages = happier users! 💝

How:

Checklist:

  • Documentation added to the
    docs site
  • Tests
  • Typescript definitions updated
  • Ready to be merged

As before: I'm not attached to this particular error message, if a reviewer can think of something better that'd be nice.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 25, 2020

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 35799ca:

Sandbox Source
kentcdodds/react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Jul 25, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@f854cde). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             master      #718   +/-   ##
==========================================
  Coverage          ?   100.00%           
==========================================
  Files             ?        24           
  Lines             ?       635           
  Branches          ?       165           
==========================================
  Hits              ?       635           
  Misses            ?         0           
  Partials          ?         0           
Impacted Files Coverage Δ
src/matches.js 100.00% <100.00%> (ø)
src/queries/display-value.js 100.00% <0.00%> (ø)
src/config.js 100.00% <0.00%> (ø)
src/screen.js 100.00% <0.00%> (ø)
src/role-helpers.js 100.00% <0.00%> (ø)
src/queries/alt-text.js 100.00% <0.00%> (ø)
src/queries/label-text.js 100.00% <0.00%> (ø)
src/queries/role.js 100.00% <0.00%> (ø)
src/queries/text.js 100.00% <0.00%> (ø)
... and 15 more

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 f854cde...35799ca. Read the comment docs.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Looking great! Just one suggested change

afontcu
afontcu previously approved these changes Jul 25, 2020
@kentcdodds kentcdodds merged commit 22988a6 into testing-library:master Jul 25, 2020
@kentcdodds
Copy link
Member

@all-contributors please add @JoshuaKGoldberg for code and tests

@allcontributors
Copy link
Contributor

@kentcdodds

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

@JoshuaKGoldberg JoshuaKGoldberg deleted the matches-null-undefined branch July 25, 2020 19:56
@kentcdodds
Copy link
Member

🎉 This PR is included in version 7.21.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.

4 participants