Skip to content
Closed
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
6 changes: 2 additions & 4 deletions test/request-signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ test('post abort signal', async (t) => {

server.listen(0, async () => {
const ac = new AbortController()
const uresPromise = request(`http://0.0.0.0:${server.address().port}`, { signal: ac.signal })
const ures = await request(`http://0.0.0.0:${server.address().port}`, { signal: ac.signal })
ac.abort()

try {
const ures = await uresPromise
/* eslint-disable-next-line no-unused-vars */
for await (const chunk of ures.body) {
// Do nothing...
Expand All @@ -63,11 +62,10 @@ test('post abort signal w/ reason', async (t) => {
server.listen(0, async () => {
const ac = new AbortController()
const _err = new Error()
const uresPromise = request(`http://0.0.0.0:${server.address().port}`, { signal: ac.signal })
const ures = await request(`http://0.0.0.0:${server.address().port}`, { signal: ac.signal })
ac.abort(_err)

try {
const ures = await uresPromise
/* eslint-disable-next-line no-unused-vars */
for await (const chunk of ures.body) {
// Do nothing...
Expand Down