Skip to content

Commit 4f6d75c

Browse files
authored
chore: reduce noice in test-logs test/issue-2349.js (#2655)
1 parent 5548984 commit 4f6d75c

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

test/issue-2349.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
'use strict'
22

3-
const { test } = require('tap')
3+
const { test } = require('node:test')
4+
const { rejects } = require('node:assert')
45
const { Writable } = require('stream')
56
const { MockAgent, stream } = require('..')
67

7-
test('stream() does not fail after request has been aborted', async (t) => {
8-
t.plan(1)
9-
8+
test('stream() does not fail after request has been aborted', () => {
109
const mockAgent = new MockAgent()
1110

1211
mockAgent.disableNetConnect()
@@ -23,8 +22,8 @@ test('stream() does not fail after request has been aborted', async (t) => {
2322

2423
setTimeout(() => ac.abort(), 5)
2524

26-
try {
27-
await stream(
25+
rejects(
26+
stream(
2827
'http://localhost:3333/',
2928
{
3029
opaque: { parts },
@@ -39,9 +38,7 @@ test('stream() does not fail after request has been aborted', async (t) => {
3938
}
4039
})
4140
}
42-
)
43-
} catch (error) {
44-
console.log(error)
45-
t.equal(error instanceof DOMException, true)
46-
}
41+
),
42+
new DOMException('This operation was aborted', 'AbortError')
43+
)
4744
})

0 commit comments

Comments
 (0)