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
794 stars 103 forks source link

add hasRef #419

Closed soferdani closed 2 years ago

soferdani commented 2 years ago

Purpose (TL;DR) - mandatory

add refed attribute to the res object


add this as required in the issue - Missing hasRef for Node #408

SimenB commented 2 years ago

Tests? 😀

codecov[bot] commented 2 years ago

Codecov Report

Merging #419 (45c414a) into master (87fd84e) will increase coverage by 0.02%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #419      +/-   ##
==========================================
+ Coverage   95.46%   95.49%   +0.02%     
==========================================
  Files           1        1              
  Lines         618      621       +3     
==========================================
+ Hits          590      593       +3     
  Misses         28       28              
Flag Coverage Δ
unit 95.49% <100.00%> (+0.02%) :arrow_up:

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

Impacted Files Coverage Δ
src/fake-timers-src.js 95.49% <100.00%> (+0.02%) :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 87fd84e...45c414a. Read the comment docs.

fatso83 commented 2 years ago

Yeah, realize we are talking about a handful of lines here, but a little test to demonstrate use would be nice

soferdani commented 2 years ago

Sorry for the delay, I added the tests as you asked (I hope..) Please let me know if you think I need to add/remove something.

fatso83 commented 2 years ago

This failed due to not running Prettier (which I fixed for you), but the tests fail as well in Chromium, since there is no conditional checking here.

mroderick commented 2 years ago

This has been published to the npm registry as 9.1.0