0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-http2-util-nghttp2error.js
James M Snell fd9d288b0b test: http2 test coverage for NghttpError
small test verifying that the NghttpError is as expected

PR-URL: https://github.com/nodejs/node/pull/15105
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-09-05 12:25:38 -07:00

17 lines
378 B
JavaScript

// Flags: --expose-internals
'use strict';
const common = require('../common');
const { strictEqual } = require('assert');
const { NghttpError } = require('internal/http2/util');
common.expectsError(() => {
const err = new NghttpError(-501);
strictEqual(err.errno, -501);
throw err;
}, {
code: 'ERR_HTTP2_ERROR',
type: NghttpError,
message: 'Invalid argument'
});