From a14c50049eaade8ff5633b2a6632ffe5d3f8a6b8 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 30 Aug 2017 15:58:05 -0700 Subject: [PATCH] test: http2 test coverage for NghttpError small test verifying that the NghttpError is as expected PR-URL: https://github.com/nodejs/node/pull/15105 Reviewed-By: Colin Ihrig Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Daniel Bevenius --- test/parallel/test-http2-util-nghttp2error.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/parallel/test-http2-util-nghttp2error.js diff --git a/test/parallel/test-http2-util-nghttp2error.js b/test/parallel/test-http2-util-nghttp2error.js new file mode 100644 index 00000000000000..7a9009515b3234 --- /dev/null +++ b/test/parallel/test-http2-util-nghttp2error.js @@ -0,0 +1,16 @@ +// Flags: --expose-internals +'use strict'; + +const common = require('../common'); +const { strictEqual } = require('assert'); +const { NghttpError } = require('internal/http2/util'); + +common.expectsError(() => { + const err = new NghttpError(-501); + strictEqual(err.errno, -501); + throw err; +}, { + code: 'ERR_HTTP2_ERROR', + type: NghttpError, + message: 'Invalid argument' +});