sinonjs / fake-timers

Fake setTimeout and friends (collectively known as "timers"). Useful in your JavaScript tests. Extracted from Sinon.JS
BSD 3-Clause "New" or "Revised" License
797 stars 104 forks source link

Const for var #392

Closed fatso83 closed 3 years ago

fatso83 commented 3 years ago

Purpose (TL;DR) - mandatory

Use one of the simpler ES2015+ features.

codecov[bot] commented 3 years ago

Codecov Report

Merging #392 (fd339b2) into master (54c2e8d) will not change coverage. The diff coverage is 96.34%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #392   +/-   ##
=======================================
  Coverage   93.84%   93.84%           
=======================================
  Files           1        1           
  Lines         585      585           
=======================================
  Hits          549      549           
  Misses         36       36           
Flag Coverage Δ
unit 93.84% <96.34%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/fake-timers-src.js 93.84% <96.34%> (ø)

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 54c2e8d...fd339b2. Read the comment docs.

benjamingr commented 3 years ago

We can probably pretty easily modernise the codebase - I thought it was ES5 "for a reason" but there are plenty of transforms/tools we can use to transform it to ES6 (like lebab iirc).

fatso83 commented 3 years ago

There was a reason and that reason went away with Sinon 10 that dropped all IE11 compatibility. We are now in in the subset of evergreen+Safari territory 😃 Feel free to do some auto-magic on the rest, but it did require a bit of manual fiddling and test reruns to get the const/let right.