Skip to content

Commit f7c6c6a

Browse files
authored
Make the fetch() abort test pass locally, on Linux and Mac, Node 18 and 19 (#1927)
Signed-off-by: Matteo Collina <hello@matteocollina.com>
1 parent aebb232 commit f7c6c6a

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

test/fetch/abort.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,14 @@ test('allows aborting with custom errors', { skip: semver.satisfies(process.vers
4343
t.teardown(server.close.bind(server))
4444
await once(server, 'listening')
4545

46-
t.test('Using AbortSignal.timeout without cause', { skip: semver.satisfies(process.version, '>= 19.0.0') }, async (t) => {
47-
await t.rejects(
48-
fetch(`http://localhost:${server.address().port}`, {
49-
signal: AbortSignal.timeout(50)
50-
}),
51-
{
52-
name: 'TimeoutError',
53-
code: DOMException.TIMEOUT_ERR
54-
}
55-
)
56-
})
57-
58-
t.test('Using AbortSignal.timeout with cause', { skip: semver.satisfies(process.version, '< 19.0.0') }, async (t) => {
46+
t.test('Using AbortSignal.timeout with cause', async (t) => {
5947
t.plan(2)
6048

6149
try {
6250
await fetch(`http://localhost:${server.address().port}`, {
6351
signal: AbortSignal.timeout(50)
6452
})
53+
t.fail('should throw')
6554
} catch (err) {
6655
if (err.name === 'TypeError') {
6756
const cause = err.cause

0 commit comments

Comments
 (0)