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

chore: reduce noise in test-logs test/issue-2349.js #2655

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Changes from all commits
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
19 changes: 8 additions & 11 deletions test/issue-2349.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use strict'

const { test } = require('tap')
const { test } = require('node:test')
const { rejects } = require('node:assert')
const { Writable } = require('stream')
const { MockAgent, stream } = require('..')

test('stream() does not fail after request has been aborted', async (t) => {
t.plan(1)

test('stream() does not fail after request has been aborted', () => {
const mockAgent = new MockAgent()

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

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

try {
await stream(
rejects(
stream(
'http://localhost:3333/',
{
opaque: { parts },
Expand All @@ -39,9 +38,7 @@ test('stream() does not fail after request has been aborted', async (t) => {
}
})
}
)
} catch (error) {
console.log(error)
t.equal(error instanceof DOMException, true)
}
),
new DOMException('This operation was aborted', 'AbortError')
)
})
Loading