From 9d7389dd5e5f99f085539f046501e2453b4e54a9 Mon Sep 17 00:00:00 2001 From: Ruwan Geeganage Date: Wed, 1 May 2019 01:15:06 +0200 Subject: [PATCH] http2: test for converting NghttpError to string --- 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'); +}