From 7e3501e039efd66e7a78addd8119c0e1e65e326e Mon Sep 17 00:00:00 2001 From: Khafra Date: Thu, 24 Oct 2024 18:32:54 -0400 Subject: [PATCH] fix http2 test --- test/http2.js | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/test/http2.js b/test/http2.js index d6840a1bd15..3f7ab3deb24 100644 --- a/test/http2.js +++ b/test/http2.js @@ -334,23 +334,15 @@ test( after(() => server.close()) after(() => client.close()) - t = tspl(t, { plan: 2 }) + t = tspl(t, { plan: 1 }) - try { - await client.request({ - path: '/', - method: 'GET', - headers: { - 'x-my-header': 'foo' - } - }) - } catch (error) { - t.strictEqual( - error.message, - 'Client network socket disconnected before secure TLS connection was established' - ) - t.strictEqual(error.code, 'ECONNRESET') - } + await t.rejects(client.request({ + path: '/', + method: 'GET', + headers: { + 'x-my-header': 'foo' + } + })) } )