diff options
author | Brian White <mscdex@mscdex.net> | 2017-01-06 04:46:12 -0500 |
---|---|---|
committer | Brian White <mscdex@mscdex.net> | 2017-01-13 16:11:19 -0500 |
commit | 57e2ec4356695265d98521df6341f3049b198f02 (patch) | |
tree | e89eb068c39f4a92127a34f92574b7f5ab7271a3 /test/parallel/test-http-client-defaults.js | |
parent | c5d0fd9641b9cc4b6340a34dd75119d899a98017 (diff) | |
download | android-node-v8-57e2ec4356695265d98521df6341f3049b198f02.tar.gz android-node-v8-57e2ec4356695265d98521df6341f3049b198f02.tar.bz2 android-node-v8-57e2ec4356695265d98521df6341f3049b198f02.zip |
test: add http.ClientRequest defaults test
PR-URL: https://github.com/nodejs/node/pull/10654
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Diffstat (limited to 'test/parallel/test-http-client-defaults.js')
-rw-r--r-- | test/parallel/test-http-client-defaults.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/parallel/test-http-client-defaults.js b/test/parallel/test-http-client-defaults.js new file mode 100644 index 0000000000..d277a60e3d --- /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'); +} |