dnaeon / go-vcr

Record and replay your HTTP interactions for fast, deterministic and accurate tests
BSD 2-Clause "Simplified" License
1.26k stars 78 forks source link

on error, report which cassette was not found #89

Closed marco-m closed 9 months ago

marco-m commented 9 months ago

Before:

requested cassette not found

After:

requested cassette not found: FILENAME

There is a caveat: this change tries to be as backwards compatible as possible, but, as the change in recorder_test.go shows, it breaks direct (!=) comparison with the sentinel error. On the other hand, one could argue that sentinel errors should always be compared with errors.Is()...

In case you are not comfortable accepting this PR, no problems!

Thanks for go-vcr, everybody I show it to starts using it :-)

dnaeon commented 9 months ago

@marco-m , LGTM, thanks!

codecov-commenter commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.69%. Comparing base (6757a75) to head (7ece2ac). Report is 1 commits behind head on v3.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## v3 #89 +/- ## ======================================= Coverage 77.69% 77.69% ======================================= Files 1 1 Lines 278 278 ======================================= Hits 216 216 Misses 48 48 Partials 14 14 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.