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 23, 2017
1 parent 43ffc9a commit 5713e74
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 5713e74

Please sign in to comment.