Skip to content

Commit

Permalink
test: add http.ClientRequest defaults test
Browse files Browse the repository at this point in the history
PR-URL: nodejs#10654
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
  • Loading branch information
mscdex authored and italoacasas committed Jan 25, 2017
1 parent 5380c48 commit 69523f6
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 69523f6

Please sign in to comment.