Skip to content

fix: add errors for queryBy* helpers when more instances found #79

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

Merged
merged 1 commit into from
Nov 29, 2018

Conversation

thymikee
Copy link
Member

Summary

Fixed all queryBy helpers to throw when they find more than 1 instances.
The previous behavior was buggy, because when more instances were found, it would still happily return null, while user expected to find 0 instances.

screenshot 2018-11-29 at 09 41 35

Test plan

Added a test.

@thymikee thymikee requested a review from Esemesek November 29, 2018 08:42
@Esemesek Esemesek merged commit bf2271d into master Nov 29, 2018
@Esemesek Esemesek deleted the feat/better-errors-for-queryBy branch November 29, 2018 09:24
thymikee added a commit to brooksbecton/react-native-testing-library that referenced this pull request Dec 11, 2018
* origin/master:
  chore: Update flow-bin to the latest version 🚀 (callstack#86)
  chore: Greenkeeper/@types/react 16.7.11 (callstack#82)
  chore: release 1.4.2
  fix: add errors for queryBy* helpers when more instances found (callstack#79)
  chore: release 1.4.1
  chore: release 1.4.1-es5.1
  fix: remove deprecated existential Flow type and use any for now (callstack#77)
  docs: add note about new APIs in v1.4 (callstack#76)
  chore: Update flow-bin to the latest version 🚀 (callstack#75)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants