Commit 732ec46
feat(async-utils): async utils advance fake timer automatically when waiting
Fixes #631
* add jestFakeTimersAreEnabled and use it to detect faketimer in createTimeoutController (#688)
* fix fakeTimer problem
* add new fakeTimer test and revise the function
* add advanceTime
* revise the advanceTime
* use jest.advanceTimersByTime
* change timeout type
* fix converage and revise type
* test(fake-timers): add more tests to test suite for fake timers
* fix the code after code review and clean up
* fix the test timeout is false
* clean up
* fix coverage
* add skip for pass checkers
* add comment
* test(async-utils): enable test to test CI fix
* test(async-utils): combine fake timer tests with async tests
* refactor(async-utils): Move DEFAULT_TIMEOUT out of timeout controller
* refactor(async-utils): move fake timer advancement into seperate utility
* refactor(async-utils): simplify fake timer advancement logic
* docs: add chris110408 as a contributor for code
* refactor(async-utils): only advance timers on a single timeoutController
BREAKING CHANGE: tests that used to manually advance fake timers and use async utilities may now
fail as timer would advance further
Co-authored-by: Lei Chen <leichen@Leis-MacBook-Pro.local>
Co-authored-by: Michael Peyper <mpeyper7@gmail.com>1 parent 8b72a87 commit 732ec46
File tree
7 files changed
+224
-230
lines changed- src
- __tests__
- core
- helpers
7 files changed
+224
-230
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
585 | 586 | | |
586 | 587 | | |
587 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
This file was deleted.
0 commit comments