Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: port first half of fetch tests to node test runner #2569

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Port issue-2171.js
  • Loading branch information
anurag-roy committed Jan 2, 2024
commit e1f7a696ed02fa99c3726a638d3d674a8b65667a
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
Loading