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