Skip to content

Commit

Permalink
test: http2 test coverage for NghttpError
Browse files Browse the repository at this point in the history
small test verifying that the NghttpError is as expected

PR-URL: #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>
  • Loading branch information
jasnell authored and MylesBorins committed Sep 12, 2017
1 parent c0dba0f commit 9f79bd8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/parallel/test-http2-util-nghttp2error.js
Original file line number Diff line number Diff line change
@@ -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'
});

0 comments on commit 9f79bd8

Please sign in to comment.