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