@@ -6,15 +6,13 @@ const { once } = require('node:events')
6
6
const { Blob } = require ( 'node:buffer' )
7
7
const { Readable } = require ( 'node:stream' )
8
8
9
- const { test, plan } = require ( 'tap' )
9
+ const { test } = require ( 'tap' )
10
10
const pem = require ( 'https-pem' )
11
11
12
12
const { Client, fetch, Headers } = require ( '../..' )
13
13
14
14
const nodeVersion = Number ( process . version . split ( 'v' ) [ 1 ] . split ( '.' ) [ 0 ] )
15
15
16
- plan ( 8 )
17
-
18
16
test ( '[Fetch] Issue#2311' , async t => {
19
17
const expectedBody = 'hello from client!'
20
18
@@ -474,65 +472,3 @@ test('Issue#2415', async (t) => {
474
472
475
473
t . doesNotThrow ( ( ) => new Headers ( response . headers ) )
476
474
} )
477
-
478
- test ( 'Issue #2386' , async t => {
479
- const server = createSecureServer ( pem )
480
- const body = Buffer . from ( 'hello' )
481
- const requestChunks = [ ]
482
- const expectedResponseBody = { hello : 'h2' }
483
- const controller = new AbortController ( )
484
- const signal = controller . signal
485
-
486
- server . on ( 'stream' , async ( stream , headers ) => {
487
- t . equal ( headers [ ':method' ] , 'PUT' )
488
- t . equal ( headers [ ':path' ] , '/' )
489
- t . equal ( headers [ ':scheme' ] , 'https' )
490
-
491
- stream . on ( 'data' , chunk => requestChunks . push ( chunk ) )
492
-
493
- stream . respond ( {
494
- 'content-type' : 'application/json' ,
495
- 'x-custom-h2' : headers [ 'x-my-header' ] ,
496
- ':status' : 200
497
- } )
498
-
499
- stream . end ( JSON . stringify ( expectedResponseBody ) )
500
- } )
501
-
502
- t . plan ( 4 )
503
-
504
- server . listen ( 0 )
505
- await once ( server , 'listening' )
506
-
507
- const client = new Client ( `https://localhost:${ server . address ( ) . port } ` , {
508
- connect : {
509
- rejectUnauthorized : false
510
- } ,
511
- allowH2 : true
512
- } )
513
-
514
- t . teardown ( server . close . bind ( server ) )
515
- t . teardown ( client . close . bind ( client ) )
516
-
517
- try {
518
- await fetch (
519
- `https://localhost:${ server . address ( ) . port } /` ,
520
- // Needs to be passed to disable the reject unauthorized
521
- {
522
- body,
523
- signal,
524
- method : 'PUT' ,
525
- dispatcher : client ,
526
- headers : {
527
- 'x-my-header' : 'foo' ,
528
- 'content-type' : 'text-plain'
529
- }
530
- }
531
- )
532
-
533
- controller . abort ( )
534
- t . pass ( )
535
- } catch ( error ) {
536
- t . error ( error )
537
- }
538
- } )
0 commit comments