Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve error messages #1185

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

Draft
rluvaton wants to merge 6 commits into testing-library:main
base: main
Choose a base branch
Loading
from rluvaton:add-support-for-better-error-message-for-matcher-fn

Conversation

Copy link

@rluvaton rluvaton commented Oct 26, 2022
edited
Loading

What: Improve the error messages

Why: #732

How: updated the getMultipleError, getMissingError

Checklist:

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

Now, for custom matchers functions we would use the:

  1. customMatcherText property on the function
  2. the function name
  3. [anonymous function]

Copy link

codesandbox-ci bot commented Oct 26, 2022
edited
Loading

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

Sandbox Source
react-testing-library-examples Configuration

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.

Looks like the changes are not fully covered by tests.

Can you structure this PR into multiple commits that make it easier to spot how error messages were changed (e.g. one commit with new tests and existing behavior and the next commit with changed behavior and updated tests)?

Copy link
Author

rluvaton commented Oct 27, 2022
edited
Loading

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

eps1lon reacted with thumbs up emoji

@rluvaton rluvaton marked this pull request as draft October 27, 2022 16:27
Copy link
Author

@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?

Copy link
Author

rluvaton commented Dec 5, 2022

@eps1lon tagging you again in case you missed that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@eps1lon eps1lon eps1lon requested changes

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /