From eda4d3c59e02769a99cb58c369674a8f8f25974c Mon Sep 17 00:00:00 2001 From: Ruwan Geeganage Date: Wed, 1 May 2019 01:15:06 +0200 Subject: [PATCH] test: converting NghttpError to string in HTTP2 module PR-URL: https://github.com/nodejs/node/pull/27506 Reviewed-By: Yongsheng Zhang Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott --- test/parallel/test-http2-util-nghttp2error.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/parallel/test-http2-util-nghttp2error.js b/test/parallel/test-http2-util-nghttp2error.js index 7a9009515b3234..100ce2cb45993b 100644 --- a/test/parallel/test-http2-util-nghttp2error.js +++ b/test/parallel/test-http2-util-nghttp2error.js @@ -14,3 +14,9 @@ common.expectsError(() => { type: NghttpError, message: 'Invalid argument' }); + +// Should convert the NghttpError object to string properly +{ + const err = new NghttpError(401); + strictEqual(err.toString(), 'Error [ERR_HTTP2_ERROR]: Unknown error code'); +}