summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-request-invalid-method-error.js
blob: 470f51a08fbc4e767abedaa569a6072e9fd1a221 (plain)
1
2
3
4
5
6
7
8
9
10
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');

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