test: add http.ClientRequest defaults test
PR-URL: https://github.com/nodejs/node/pull/10654 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
This commit is contained in:
parent
c5d0fd9641
commit
57e2ec4356
24
test/parallel/test-http-client-defaults.js
Normal file
24
test/parallel/test-http-client-defaults.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
'use strict';
|
||||||
|
require('../common');
|
||||||
|
const assert = require('assert');
|
||||||
|
const ClientRequest = require('http').ClientRequest;
|
||||||
|
|
||||||
|
function noop() {}
|
||||||
|
|
||||||
|
{
|
||||||
|
const req = new ClientRequest({ createConnection: noop });
|
||||||
|
assert.strictEqual(req.path, '/');
|
||||||
|
assert.strictEqual(req.method, 'GET');
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const req = new ClientRequest({ method: '', createConnection: noop });
|
||||||
|
assert.strictEqual(req.path, '/');
|
||||||
|
assert.strictEqual(req.method, 'GET');
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const req = new ClientRequest({ path: '', createConnection: noop });
|
||||||
|
assert.strictEqual(req.path, '/');
|
||||||
|
assert.strictEqual(req.method, 'GET');
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user