From 43454d48482ac7c60f04d5656f6d4f0355ed6eb3 Mon Sep 17 00:00:00 2001 From: himself65 Date: Wed, 31 Jul 2019 22:24:28 +0800 Subject: [PATCH] test: http2.connect call destroy when init fail --- test/parallel/test-http2-connect.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/parallel/test-http2-connect.js b/test/parallel/test-http2-connect.js index a1291e3be956e1..4569905eac9be1 100644 --- a/test/parallel/test-http2-connect.js +++ b/test/parallel/test-http2-connect.js @@ -69,6 +69,20 @@ const { connect: netConnect } = require('net'); connect(authority).on('error', () => {}); } +// Check for error for init settings error +{ + createServer(function() { + connect(`http://localhost:${this.address().port}`, { + settings: { + maxFrameSize: 1 // An incorrect settings + } + }).on('error', expectsError({ + code: 'ERR_HTTP2_INVALID_SETTING_VALUE', + type: RangeError + })); + }); +} + // Check for error for an invalid protocol (not http or https) { const authority = 'ssh://localhost';