Skip to content

Commit

Permalink
Port issue-2171.js
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag-roy committed Jan 2, 2024
1 parent 8060c4f commit e1f7a69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/fetch/issue-2171.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
const { fetch } = require('../..')
const { once } = require('events')
const { createServer } = require('http')
const { test } = require('tap')
const { test } = require('node:test')
const assert = require('node:assert')

test('error reason is forwarded - issue #2171', { skip: !AbortSignal.timeout }, async (t) => {
const server = createServer(() => {}).listen(0)

t.teardown(server.close.bind(server))
t.after(server.close.bind(server))
await once(server, 'listening')

const timeout = AbortSignal.timeout(100)
await t.rejects(
await assert.rejects(
fetch(`http://localhost:${server.address().port}`, {
signal: timeout
}),
Expand Down

0 comments on commit e1f7a69

Please sign in to comment.