Movatterモバイル変換


[0]ホーム

URL:


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

feat(waitFor): Automatically advance Jest fake timers#878

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
eps1lon wants to merge1 commit intotesting-library:main
base:main
Choose a base branch
Loading
fromeps1lon:feat/waitfor-jest-fake-timers

Conversation

eps1lon
Copy link
Member

@eps1loneps1lon commentedJul 19, 2022
edited
Loading

What:

Closes#873

Why:

There's little value inwaitFor if one has to advance timers by themselves.

How:

Copy implementation from@testing-library/dom.

There's an opportunity to write a more genericwaitFor that we can share across Testing Library that specific host configs build on top on (e.g. also running MutationObserver in/dom). But that requires more coordination (starting with an extensive test suite). For now this hopefully suffices (pending testing in actual codebases).

Checklist:

  • Documentation updated
  • Tests
    • timing out
    • timing out without a callback error
    • switching to real timers
  • Test in actual codebase
  • Ready to be merged
  • Added myself to contributors table

@netlify
Copy link

netlifybot commentedJul 19, 2022
edited
Loading

Deploy Preview forreact-hooks-testing-library failed.

NameLink
🔨 Latest commit18bfadf
🔍 Latest deploy loghttps://app.netlify.com/sites/react-hooks-testing-library/deploys/62d7140dcdefdf00088cc613

@eps1loneps1lonforce-pushed thefeat/waitfor-jest-fake-timers branch from30e6f0f to18bfadfCompareJuly 19, 2022 20:28
// to resolve before continuing. We don't need to take advantage
// of parallelization so we're fine.
// https://stackoverflow.com/a/59243586/971592
await act(async () => {
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is useless for React 17 and should be removed to not confuse. It is only needed in 18 where we need to remove theact fromwaitFor

@SimenB
Copy link

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Tests timeout with jest fakeTimers and waitFor for on Promise.resolve calls
2 participants
@eps1lon@SimenB

[8]ページ先頭

©2009-2025 Movatter.jp