node/test/parallel/test-http-client-insecure-http-parser-error.js

15 lines
364 B
JavaScript
Raw Permalink Normal View History

'use strict';
require('../common');
const assert = require('assert');
const ClientRequest = require('http').ClientRequest;
{
assert.throws(() => {
new ClientRequest({ insecureHTTPParser: 'wrongValue' });
}, {
code: 'ERR_INVALID_ARG_TYPE',
message: /insecureHTTPParser/
}, 'http request should throw when passing invalid insecureHTTPParser');
}