aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-util-nghttp2error.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-08-30 15:58:05 -0700
committerJames M Snell <jasnell@gmail.com>2017-09-05 12:25:38 -0700
commitfd9d288b0b17d2d8353f68a17e4ed2d420d52922 (patch)
tree6db2a222dd624d7376d1df2b329234aaf30fb5fa /test/parallel/test-http2-util-nghttp2error.js
parent2f9d9e5fe3b09d3fe54bbf04a61b1fe8289414c0 (diff)
downloadandroid-node-v8-fd9d288b0b17d2d8353f68a17e4ed2d420d52922.tar.gz
android-node-v8-fd9d288b0b17d2d8353f68a17e4ed2d420d52922.tar.bz2
android-node-v8-fd9d288b0b17d2d8353f68a17e4ed2d420d52922.zip
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 <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-util-nghttp2error.js')
-rw-r--r--test/parallel/test-http2-util-nghttp2error.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/parallel/test-http2-util-nghttp2error.js b/test/parallel/test-http2-util-nghttp2error.js
new file mode 100644
index 0000000000..7a9009515b
--- /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'
+});