Skip to content

Commit

Permalink
chore(tests): use minipass concat() on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiahdz committed Oct 1, 2019
1 parent de1bee7 commit 119e479
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions test/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,9 @@ test('supports request streaming', t => {
cacheManager: CACHE,
retry: {retries: 0}
}).then(res => {
let buf = []
let bufLen = 0
res.body.on('data', d => { buf.push(d); bufLen += d.length })
return res.body.promise().then(() => {
return res.body.concat().then(data => {
t.deepEqual(
Buffer.concat(buf, bufLen),
data,
CONTENT,
'initial request streamed correct content'
)
Expand All @@ -174,12 +171,9 @@ test('supports request streaming', t => {
cacheManager: CACHE
})
}).then(res => {
let buf = []
let bufLen = 0
res.body.on('data', d => { buf.push(d); bufLen += d.length })
return res.body.promise().then(() => {
return res.body.concat().then(data => {
t.deepEqual(
Buffer.concat(buf, bufLen),
data,
CONTENT,
'cached request streamed correct content'
)
Expand Down

0 comments on commit 119e479

Please sign in to comment.