Skip to content

Commit

Permalink
chore: reduce noice in test-logs test/issue-2349.js (#2655)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Jan 27, 2024
1 parent 5548984 commit 4f6d75c
Showing 1 changed file with 8 additions and 11 deletions.
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')
)
})

0 comments on commit 4f6d75c

Please sign in to comment.