Skip to content

Commit 57e2ec4

Browse files
committed
test: add http.ClientRequest defaults test
PR-URL: #10654 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
1 parent c5d0fd9 commit 57e2ec4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
require('../common');
3+
const assert = require('assert');
4+
const ClientRequest = require('http').ClientRequest;
5+
6+
function noop() {}
7+
8+
{
9+
const req = new ClientRequest({ createConnection: noop });
10+
assert.strictEqual(req.path, '/');
11+
assert.strictEqual(req.method, 'GET');
12+
}
13+
14+
{
15+
const req = new ClientRequest({ method: '', createConnection: noop });
16+
assert.strictEqual(req.path, '/');
17+
assert.strictEqual(req.method, 'GET');
18+
}
19+
20+
{
21+
const req = new ClientRequest({ path: '', createConnection: noop });
22+
assert.strictEqual(req.path, '/');
23+
assert.strictEqual(req.method, 'GET');
24+
}

0 commit comments

Comments
 (0)