aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-respond-file-204.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-http2-respond-file-204.js')
-rw-r--r--test/parallel/test-http2-respond-file-204.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/parallel/test-http2-respond-file-204.js b/test/parallel/test-http2-respond-file-204.js
index 8181dbb317..4be2d42c77 100644
--- a/test/parallel/test-http2-respond-file-204.js
+++ b/test/parallel/test-http2-respond-file-204.js
@@ -5,7 +5,6 @@ if (!common.hasCrypto)
common.skip('missing crypto');
const fixtures = require('../common/fixtures');
const http2 = require('http2');
-const assert = require('assert');
const {
HTTP2_HEADER_CONTENT_TYPE,
@@ -16,16 +15,16 @@ const fname = fixtures.path('elipses.txt');
const server = http2.createServer();
server.on('stream', (stream) => {
- assert.throws(() => {
+ common.expectsError(() => {
stream.respondWithFile(fname, {
[HTTP2_HEADER_STATUS]: 204,
[HTTP2_HEADER_CONTENT_TYPE]: 'text/plain'
});
- }, common.expectsError({
+ }, {
code: 'ERR_HTTP2_PAYLOAD_FORBIDDEN',
type: Error,
message: 'Responses with 204 status must not have a payload'
- }));
+ });
stream.respond({});
stream.end();
});