Skip to content

Commit

Permalink
test: add http.ClientRequest defaults test
Browse files Browse the repository at this point in the history
PR-URL: #10654
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
  • Loading branch information
mscdex committed Jan 13, 2017
1 parent c5d0fd9 commit 57e2ec4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/parallel/test-http-client-defaults.js
Original file line number Diff line number Diff line change
@@ -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');
}

0 comments on commit 57e2ec4

Please sign in to comment.