Closed hassy closed 8 years ago
Two if (err) {}
branches are set to be ignored for coverage - I don't see an easy way to test those branches, maybe @nelsonic can offer some ideas? (Personally I'd be happy ignoring those for coverage).
@@ master #26 diff @@
==========================================
Files 4 4
Lines 61 63 +2
Methods 9 9
Messages 0 0
Branches 13 15 +2
==========================================
+ Hits 61 63 +2
Misses 0 0
Partials 0 0
Powered by Codecov. Last updated by c401a88...5e6a993
Two if (err) {} branches are set to be ignored for coverage - I don't see an easy way to test those branches, maybe @nelsonic can offer some ideas? (Personally I'd be happy ignoring those for coverage).
Should be easy to use sinon
and mock / stub those handler.methods to always return an error and assert that the failed callback is called?
@tomgco Yeah, I'll do that.
Those two branches would only be exercised if:
lambda-taggable-geonames
lambda failsSo a test that exercises those branches is literally testing the implementation, but I guess you must do that for 100% coverage (not sold on this personally).
@hassy no objection to the /* istanbul ignore if */
the handler.initTagDoc
should not throw an error ... and jumping through hoops using mocks in order to throw and error is "testing the implementation" ...
Added tests to cover those anyway :)
@hassy cool. 🍭