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

test: Backport tests using the full timer matrix #962

Merged
merged 1 commit into from Sep 12, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Sep 12, 2021

What:

Adds tests for waitFor, waitForElementToBeRemoved and findBy across all supported timer implementations (real timers, jest legacy fake timers, jest modern fake timers).

Why:

These offer a more granular coverage that's required for #937.
The new tests are also the only tests that would trigger a missing act warning if we were to remove the asyncWrapper.

How:

Backport tests from #937 and convert the class component to a function component. With a class component we'd still not get a missing act warning.

Checklist:

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

@codesandbox-ci
Copy link

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 b6ce4fa:

Sandbox Source
React Configuration
react-testing-library-examples Configuration

Copy link
Member

@MatanBobi MatanBobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :)

@codecov
Copy link

codecov bot commented Sep 12, 2021

Codecov Report

Merging #962 (b6ce4fa) into main (3325061) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #962   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          140       140           
  Branches        28        28           
=========================================
  Hits           140       140           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3325061...b6ce4fa. Read the comment docs.

@eps1lon eps1lon merged commit 84851dc into testing-library:main Sep 12, 2021
@eps1lon eps1lon deleted the test/missing-act branch September 12, 2021 09:12
@github-actions
Copy link

🎉 This PR is included in version 13.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 12.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants