Skip to content

Commit

Permalink
refactor: remove cruft
Browse files Browse the repository at this point in the history
Unable to find a way to trigger the conditionals. See #1404 for reasoning why I took on this test.
  • Loading branch information
RichardLitt authored and gr2m committed Sep 4, 2019
1 parent cce2439 commit 98dfe07
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions lib/recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,7 @@ const getBodyFromChunks = function(chunks, headers) {
// of hex strings so that the responses can be mocked one by one.
if (common.isContentEncoded(headers)) {
return {
// TODO-coverage: Try to add a test for this case. If we can't figure
// out how to do that, remove the code.
body: _.map(chunks, function(chunk) {
if (!Buffer.isBuffer(chunk)) {
if (typeof chunk === 'string') {
chunk = Buffer.from(chunk)
} else {
throw new Error(
'content-encoded responses must all be binary buffers'
)
}
}

return chunk.toString('hex')
}),
body: _.map(chunks, chunk => chunk.toString('hex')),
}
}

Expand Down

0 comments on commit 98dfe07

Please sign in to comment.