From 24eceddd3c240600041d45f7b257b02c97b04b40 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Wed, 15 May 2019 15:48:46 +0100 Subject: [PATCH] test: add test for config set with number License: MIT Signed-off-by: Alan Shaw --- src/config/set.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/config/set.js b/src/config/set.js index 6570413a9..50b1be49f 100644 --- a/src/config/set.js +++ b/src/config/set.js @@ -59,6 +59,19 @@ module.exports = (createCommon, options) => { }) }) + it('should set a number', (done) => { + const key = 'Discovery.MDNS.Interval' + const val = 11 + ipfs.config.set(key, val, function (err) { + expect(err).to.not.exist() + ipfs.config.get(key, function (err, result) { + expect(err).to.not.exist() + expect(result).to.equal(val) + done() + }) + }) + }) + it('should set a JSON object', (done) => { const key = 'API.HTTPHeaders.Access-Control-Allow-Origin' const val = ['http://example.io']