Skip to content

Commit

Permalink
Fix URL test
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Jun 11, 2024
1 parent 75df3e9 commit dddf1de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,14 @@ test('make requests using url', async function (t) {
res.end('response')
})

const _url = `http://0.0.0.0:${server.address().port}/path`
const url = `http://localhost:${server.address().port}/path`
const expectedBuf = Buffer.from('response')

http.request(_url, res => {
http.request(url, res => {
res.on('data', (data) => rqts.alike(data, expectedBuf, 'url as string'))
}).end()

http.request(new URL(_url), res => {
http.request(new URL(url), res => {
res.on('data', (data) => rqts.alike(data, expectedBuf, 'url instance'))
}).end()

Expand Down

0 comments on commit dddf1de

Please sign in to comment.