timkindberg / jest-when

Jest support for mock argument-matched return values.
MIT License
734 stars 38 forks source link

Fix non-chained default implementations (fixes #57) #58

Closed devzeebo closed 3 years ago

codecov-io commented 3 years ago

Codecov Report

Merging #58 (bf5e3f2) into master (95f53e5) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #58   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           96        97    +1     
=========================================
+ Hits            96        97    +1     
Impacted Files Coverage Δ
src/when.js 100.00% <100.00%> (ø)

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 95f53e5...bf5e3f2. Read the comment docs.

timkindberg commented 3 years ago

Does this also fix #24 ?

timkindberg commented 3 years ago

Thanks BTW :)

timkindberg commented 3 years ago

jest-when@3.1.0

devzeebo commented 3 years ago

Unfortunately it doesn't fix #24, since the mock implementation isn't overridden until line 62. You'd have to declare the mock implementation in the constructor in order to enable it to be overridden with only a default implementation