From 4b0ebf397ec8b9a890d3e226114e4ac24675df34 Mon Sep 17 00:00:00 2001 From: thisconnect Date: Mon, 19 Jun 2017 11:39:37 +0200 Subject: [PATCH 1/2] adds test getConfig without key, should get the whole config see https://ipfs.github.io/js-ipfsd-ctl/#nodegetconfig If no key is passed, the whole config is returned as an object. --- test/index.spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/index.spec.js b/test/index.spec.js index d2cd7e23..745566c6 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -322,6 +322,14 @@ describe('daemons', () => { }) }) + it('Should return the whole config', (done) => { + ipfsNode.getConfig((err, config) => { + expect(err).to.not.exist() + expect(config).to.exist() + done() + }) + }) + it('Should set a config value', (done) => { async.series([ (cb) => ipfsNode.setConfig('Bootstrap', 'null', cb), From 7a962436f3690880c9892db7815859336aad1b24 Mon Sep 17 00:00:00 2001 From: thisconnect Date: Mon, 19 Jun 2017 11:42:46 +0200 Subject: [PATCH 2/2] fix: getConfig without key should get the whole config --- src/node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.js b/src/node.js index cf9492d9..3bad47f4 100644 --- a/src/node.js +++ b/src/node.js @@ -306,7 +306,7 @@ class Node { getConfig (key, callback) { if (typeof key === 'function') { callback = key - key = '' + key = 'show' } async.waterfall([