Skip to content

Commit e5fd97e

Browse files
committed
test: remove duplicated test
1 parent d5c7e37 commit e5fd97e

File tree

1 file changed

+1
-65
lines changed

1 file changed

+1
-65
lines changed

test/fetch/http2.js

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ const { once } = require('node:events')
66
const { Blob } = require('node:buffer')
77
const { Readable } = require('node:stream')
88

9-
const { test, plan } = require('tap')
9+
const { test } = require('tap')
1010
const pem = require('https-pem')
1111

1212
const { Client, fetch, Headers } = require('../..')
1313

1414
const nodeVersion = Number(process.version.split('v')[1].split('.')[0])
1515

16-
plan(8)
17-
1816
test('[Fetch] Issue#2311', async t => {
1917
const expectedBody = 'hello from client!'
2018

@@ -474,65 +472,3 @@ test('Issue#2415', async (t) => {
474472

475473
t.doesNotThrow(() => new Headers(response.headers))
476474
})
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

Comments
 (0)