nodejs/test/parallel/test-http-request-invalid-method-error.js
Weijia Wang bdfbce9241 http_client, errors: migrate to internal/errors
PR-URL: https://github.com/nodejs/node/pull/14423
Refs: https://github.com/nodejs/node/issues/11273
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-01 14:08:12 +02:00

14 lines
309 B
JavaScript

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