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

Use recommended pattern in testing example #28404

Merged
merged 11 commits into from
Aug 25, 2021
Merged

Use recommended pattern in testing example #28404

merged 11 commits into from
Aug 25, 2021

Commits on Aug 25, 2021

  1. 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
    htunnicliff committed Aug 25, 2021
    Configuration menu
    Copy the full SHA
    81fc57a View commit details
    Browse the repository at this point in the history
  2. Update devDependencies

    htunnicliff committed Aug 25, 2021
    Configuration menu
    Copy the full SHA
    c74d902 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d4bc8c7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9aefc34 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3bab0ec View commit details
    Browse the repository at this point in the history
  6. Update docs

    htunnicliff committed Aug 25, 2021
    Configuration menu
    Copy the full SHA
    9b5d6d3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    dd211d4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    497d698 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7cee90c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8bb1152 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e2deb13 View commit details
    Browse the repository at this point in the history