Skip to content

test: correct false-negative for advancing timers#948

Merged
ph-fritsche merged 1 commit intomainfrom
fix-test
May 10, 2022
Merged

test: correct false-negative for advancing timers#948
ph-fritsche merged 1 commit intomainfrom
fix-test

Conversation

@ph-fritsche
Copy link
Copy Markdown
Member

What:

Rewrite test.

Why:

Previous test would not fail if advanceTimers wasn't applied.

test('advances timers when set', async () => {
jest.useFakeTimers()
jest.setTimeout(50)
// If this wasn't advancing fake timers, we'd timeout and fail the test
await wait(10000, jest.advanceTimersByTime)
jest.useRealTimers()
})

validate script doesn't typecheck tests 😞
We need to fix that.

Checklist:

  • Tests
  • Ready to be merged

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented May 9, 2022

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

Sandbox Source
userEvent-dom Configuration
userEvent-react Configuration

@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2022

Codecov Report

Merging #948 (7fb4763) into main (ee062e7) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main      #948   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           85        85           
  Lines         1784      1784           
  Branches       641       658   +17     
=========================================
  Hits          1784      1784           

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 ee062e7...7fb4763. Read the comment docs.

@ph-fritsche ph-fritsche merged commit bf00145 into main May 10, 2022
@ph-fritsche ph-fritsche deleted the fix-test branch May 10, 2022 08:38
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 14.2.0 🎉

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant