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 2019-05-01 01:15:06 +02:00 committed by ZYSzys
parent 96c789287b
commit eda4d3c59e

View File

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