File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ const cp = require('child_process')
77const path = require ( 'path' )
88const net = require ( 'net' )
99const fs = require ( 'fs' )
10- const stream = require ( 'stream' )
1110
1211/** @type {import('../types') } */
1312const postgres = require ( '../lib' )
@@ -1422,7 +1421,6 @@ t('Copy from works in transaction', async() => {
14221421
14231422t ( '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 [
You can’t perform that action at this time.
0 commit comments