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' + } + })) } )