Closed rgroothuijsen closed 4 years ago
Merging #328 into master will increase coverage by
0.01%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #328 +/- ##
==========================================
+ Coverage 93.11% 93.12% +0.01%
==========================================
Files 1 1
Lines 552 553 +1
==========================================
+ Hits 514 515 +1
Misses 38 38
Flag | Coverage Δ | |
---|---|---|
#unit | 93.12% <100.00%> (+0.01%) |
:arrow_up: |
Impacted Files | Coverage Δ | |
---|---|---|
src/fake-timers-src.js | 93.12% <100.00%> (+0.01%) |
:arrow_up: |
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 89e9e9b...2bcf132. Read the comment docs.
Purpose
Fix issue #187 by adding an actual implementation to
refresh()
.Background
Previously,
refresh()
was added to the timer API as an alternative to manually resetting timeouts viaclearTimeout()
andsetTimeout()
. However, while the interface itself was added, it remained a no-op function. This is confusing, since the presence of this function creates the expectation that the timer has been refreshed when it actually hasn't.Solution
refresh()
now clears the existing timeout and generates a new one with the same function and delay parameters, but a new ID.