test: converting NghttpError to string in HTTP2 module

PR-URL: https://github.com/nodejs/node/pull/27506
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Ruwan Geeganage authored and Michaël Zasso committed 2019-05-05 12:43:00 +02:00
1 parent bb373d0def
commit ca720b3a55
1 file changed
+6
@@ -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');
}