-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Use recommended pattern in testing example #28404
Merged
Merged
Commits on Aug 25, 2021
-
Use recommended pattern in testing example
Since the official linter for testing library, `eslint-plugin-testing-library` recommends using `screen` to write queries, this MR updates the testing library example to follow the pattern recommended by the linter. > DOM Testing Library (and other Testing Library frameworks built on top of it) exports a screen object which has every query (and a debug method). This works better with autocomplete and makes each test a little simpler to write and maintain. > This rule aims to force writing tests using built-in queries directly from screen object rather than destructuring them from render result. Given the screen component does not expose utility methods such as rerender() or the container property, it is correct to use the render returned value in those scenarios. See the `prefer-screen-queries` rules docs for more info: https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-screen-queries.md
Configuration menu - View commit details
-
Copy full SHA for 81fc57a - Browse repository at this point
Copy the full SHA 81fc57aView commit details -
Configuration menu - View commit details
-
Copy full SHA for c74d902 - Browse repository at this point
Copy the full SHA c74d902View commit details -
Configuration menu - View commit details
-
Copy full SHA for d4bc8c7 - Browse repository at this point
Copy the full SHA d4bc8c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9aefc34 - Browse repository at this point
Copy the full SHA 9aefc34View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3bab0ec - Browse repository at this point
Copy the full SHA 3bab0ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b5d6d3 - Browse repository at this point
Copy the full SHA 9b5d6d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd211d4 - Browse repository at this point
Copy the full SHA dd211d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 497d698 - Browse repository at this point
Copy the full SHA 497d698View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7cee90c - Browse repository at this point
Copy the full SHA 7cee90cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8bb1152 - Browse repository at this point
Copy the full SHA 8bb1152View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2deb13 - Browse repository at this point
Copy the full SHA e2deb13View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.