@@ -414,6 +414,7 @@ describe('createWebSocketStream', () => {
414
414
ws . _receiver . on ( 'drain' , ( ) => {
415
415
called . push ( 'drain' ) ;
416
416
assert . ok ( ! ws . _socket . isPaused ( ) ) ;
417
+ duplex . end ( ) ;
417
418
} ) ;
418
419
419
420
const list = Sender . frame ( randomBytes ( 16 * 1024 ) , {
@@ -429,7 +430,6 @@ describe('createWebSocketStream', () => {
429
430
ws . _socket . push ( Buffer . concat ( list ) ) ;
430
431
} ) ;
431
432
432
- duplex . on ( 'resume' , duplex . end ) ;
433
433
duplex . on ( 'close' , ( ) => {
434
434
assert . deepStrictEqual ( called , [ 'read' , 'drain' ] ) ;
435
435
wss . close ( done ) ;
@@ -450,6 +450,7 @@ describe('createWebSocketStream', () => {
450
450
assert . ok ( ! ws . _receiver . _writableState . needDrain ) ;
451
451
read ( ) ;
452
452
assert . ok ( ! ws . _socket . isPaused ( ) ) ;
453
+ duplex . end ( ) ;
453
454
} ;
454
455
455
456
ws . on ( 'open' , ( ) => {
@@ -470,7 +471,6 @@ describe('createWebSocketStream', () => {
470
471
ws . _socket . push ( Buffer . concat ( list ) ) ;
471
472
} ) ;
472
473
473
- duplex . on ( 'resume' , duplex . end ) ;
474
474
duplex . on ( 'close' , ( ) => {
475
475
assert . deepStrictEqual ( called , [ 'drain' , 'read' ] ) ;
476
476
wss . close ( done ) ;
0 commit comments