NagRock / ts-mockito

Mocking library for TypeScript
MIT License
974 stars 93 forks source link

Fixes byCallIndex error messages #213

Closed freekh closed 3 years ago

freekh commented 3 years ago

If index was less 0 (in the case of calling last() on a captured method that had not been called at all), a TypeError ('last' of undefined) would be thrown.

codecov-commenter commented 3 years ago

Codecov Report

Merging #213 (cb2b837) into master (6637048) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #213   +/-   ##
=======================================
  Coverage   93.55%   93.55%           
=======================================
  Files          34       34           
  Lines         652      652           
  Branches       80       80           
=======================================
  Hits          610      610           
  Misses         30       30           
  Partials       12       12           
Impacted Files Coverage Δ
src/capture/ArgCaptor.ts 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 6637048...cb2b837. Read the comment docs.

NagRock commented 3 years ago

Thanks. I've added spec for that case: https://github.com/NagRock/ts-mockito/pull/215