Skip to content

Commit 451acbc

Browse files
committed
No reason to use abortcontroller in test
1 parent 8150005 commit 451acbc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/index.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const cp = require('child_process')
77
const path = require('path')
88
const net = require('net')
99
const fs = require('fs')
10-
const stream = require('stream')
1110

1211
/** @type {import('../types')} */
1312
const postgres = require('../lib')
@@ -1422,7 +1421,6 @@ t('Copy from works in transaction', async() => {
14221421

14231422
t('Copy from abort works', async() => {
14241423
const sql = postgres(options)
1425-
const controller = new AbortController()
14261424
const readable = fs.createReadStream('copy.csv')
14271425

14281426
await sql`create table test (x int, y int, z int)`
@@ -1433,10 +1431,10 @@ t('Copy from abort works', async() => {
14331431
let aborted
14341432

14351433
readable
1436-
.pipe(stream.addAbortSignal(controller.signal, writable))
1434+
.pipe(writable)
14371435
.on('error', () => aborted = true)
14381436

1439-
controller.abort()
1437+
writable.destroy(new Error('abort'))
14401438
await sql.end()
14411439

14421440
return [

0 commit comments

Comments
 (0)