File tree 1 file changed +2
-4
lines changed
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')
7
7
const path = require ( 'path' )
8
8
const net = require ( 'net' )
9
9
const fs = require ( 'fs' )
10
- const stream = require ( 'stream' )
11
10
12
11
/** @type {import('../types') } */
13
12
const postgres = require ( '../lib' )
@@ -1422,7 +1421,6 @@ t('Copy from works in transaction', async() => {
1422
1421
1423
1422
t ( 'Copy from abort works' , async ( ) => {
1424
1423
const sql = postgres ( options )
1425
- const controller = new AbortController ( )
1426
1424
const readable = fs . createReadStream ( 'copy.csv' )
1427
1425
1428
1426
await sql `create table test (x int, y int, z int)`
@@ -1433,10 +1431,10 @@ t('Copy from abort works', async() => {
1433
1431
let aborted
1434
1432
1435
1433
readable
1436
- . pipe ( stream . addAbortSignal ( controller . signal , writable ) )
1434
+ . pipe ( writable )
1437
1435
. on ( 'error' , ( ) => aborted = true )
1438
1436
1439
- controller . abort ( )
1437
+ writable . destroy ( new Error ( 'abort' ) )
1440
1438
await sql . end ( )
1441
1439
1442
1440
return [
You can’t perform that action at this time.
0 commit comments