Skip to content

Commit 9f79bd8

Browse files
jasnellMylesBorins
authored andcommitted
test: http2 test coverage for NghttpError
small test verifying that the NghttpError is as expected PR-URL: #15105 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
1 parent c0dba0f commit 9f79bd8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Flags: --expose-internals
2+
'use strict';
3+
4+
const common = require('../common');
5+
const { strictEqual } = require('assert');
6+
const { NghttpError } = require('internal/http2/util');
7+
8+
common.expectsError(() => {
9+
const err = new NghttpError(-501);
10+
strictEqual(err.errno, -501);
11+
throw err;
12+
}, {
13+
code: 'ERR_HTTP2_ERROR',
14+
type: NghttpError,
15+
message: 'Invalid argument'
16+
});

0 commit comments

Comments
 (0)