Skip to content

Commit

Permalink
chore: fix tests for node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Sep 18, 2023
1 parent fceed29 commit 250e493
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions test/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ t.test('json FetchError', async t => {
t.same(await new Body('{"a":1}').json(), { a: 1 })
await t.rejects(Object.assign(new Body('a=1'), { url: 'asdf' }).json(), {
name: 'FetchError',
message: 'invalid json response body at asdf reason: ' +
'Unexpected token a in JSON at position 0',
message: /^invalid json response body at asdf reason: Unexpected token/,
type: 'invalid-json',
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ t.test('supports supplying a famliy option to the agent', async t => {
const family = Symbol('family')
function lookupSpy (hostname, options, callback) {
families.push(options.family)
return lookup(hostname, {}, callback)
return lookup(hostname, { ...options, family: undefined }, callback)
}
const agent = http.Agent({ lookup: lookupSpy, family })
await fetch(url, { agent })
Expand Down

0 comments on commit 250e493

Please sign in to comment.