From 57e2ec4356695265d98521df6341f3049b198f02 Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 6 Jan 2017 04:46:12 -0500 Subject: [PATCH] test: add http.ClientRequest defaults test PR-URL: https://github.com/nodejs/node/pull/10654 Reviewed-By: James M Snell Reviewed-By: Fedor Indutny --- test/parallel/test-http-client-defaults.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/parallel/test-http-client-defaults.js diff --git a/test/parallel/test-http-client-defaults.js b/test/parallel/test-http-client-defaults.js new file mode 100644 index 00000000000000..d277a60e3df55e --- /dev/null +++ b/test/parallel/test-http-client-defaults.js @@ -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'); +}