summaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-connect.js
diff options
context:
space:
mode:
authorhimself65 <himself65@outlook.com>2019-07-31 22:20:13 +0800
committerRich Trott <rtrott@gmail.com>2019-08-02 12:02:48 -0700
commit2b03e1d0a5ef2a52e4d7ce550b74a961c62e185a (patch)
tree4a8c2cd19438696127570b9223645f507b0a46f5 /test/parallel/test-http2-connect.js
parent36864a60fa25394fa034a9bea7c9928c301c0d8f (diff)
downloadandroid-node-v8-2b03e1d0a5ef2a52e4d7ce550b74a961c62e185a.tar.gz
android-node-v8-2b03e1d0a5ef2a52e4d7ce550b74a961c62e185a.tar.bz2
android-node-v8-2b03e1d0a5ef2a52e4d7ce550b74a961c62e185a.zip
http2: destroy when settingsFn throws an error
http2.connect should call destroy when init fails. PR-URL: https://github.com/nodejs/node/pull/28908 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-connect.js')
-rw-r--r--test/parallel/test-http2-connect.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/parallel/test-http2-connect.js b/test/parallel/test-http2-connect.js
index a1291e3be9..4569905eac 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';