testing-library / dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.26k stars 466 forks source link

Improve error messages #1185

Open rluvaton opened 1 year ago

rluvaton commented 1 year ago

What: Improve the error messages

Why: #732

How: updated the getMultipleError, getMissingError

Checklist:

Now, for custom matchers functions we would use the:

  1. customMatcherText property on the function
  2. the function name
  3. [anonymous function]
codesandbox-ci[bot] commented 1 year ago

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 56dd0e4eabcf3b484534f479cd6fb689891291b4:

Sandbox Source
react-testing-library-examples Configuration
rluvaton commented 1 year ago

Hey, I did not finish (this is why I haven't checked the ready to merge checkbox) 😄 I'll convert this into a draft

rluvaton commented 1 year ago

@eps1lon for some reason the tests fail on get throws a useful error message › ByText › Multiple elements do you know why?

the snapshots are the same

image

also, how do you want me to organize my changes?

rluvaton commented 1 year ago

@eps1lon tagging you again in case you missed that