Skip to content

Commit

Permalink
fix js tests for node v19+
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Dec 18, 2022
1 parent 88ef1de commit 55e2738
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/js-api-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3855,14 +3855,14 @@ let serveTests = {
// Subtract 1 because range headers are inclusive on both ends
Range: `bytes=${start}-${start + length - 1}`,
})
delete fetched.headers.date
delete fetched.headers.date // This changes every time
delete fetched.headers.connection // Node v19+ no longer sends this
const expected = buffer.slice(start, start + length)
expected.headers = {
'access-control-allow-origin': '*',
'content-length': `${length}`,
'content-range': `bytes ${start}-${start + length - 1}/${byteCount}`,
'content-type': 'application/octet-stream',
'connection': 'close',
}
assert.deepStrictEqual(fetched, expected)
}
Expand Down

0 comments on commit 55e2738

Please sign in to comment.