mirror of https://github.com/lukechilds/node.git
Browse Source
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>canary-base
James M Snell
7 years ago
1 changed files with 16 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||
// 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' |
|||
}); |
Loading…
Reference in new issue