node/test/parallel/test-http-request-invalid-method-error.js
Mithun Sasidharan acd4277134
test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17497
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-08 13:37:33 -05:00

13 lines
271 B
JavaScript

'use strict';
const common = require('../common');
const http = require('http');
common.expectsError(
() => http.request({ method: '\0' }),
{
code: 'ERR_INVALID_HTTP_TOKEN',
type: TypeError,
message: 'Method must be a valid HTTP token ["\u0000"]'
}
);