From 3964cfbc3284d3dd085185e42d23ec1acf9cb62f Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Mon, 6 Aug 2018 08:40:17 +0100 Subject: [PATCH 1/2] fix: expect config to be an object License: MIT Signed-off-by: Henrique Dias --- js/src/config/get.js | 7 +++++-- package.json | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/config/get.js b/js/src/config/get.js index b6730af3..c5d8500c 100644 --- a/js/src/config/get.js +++ b/js/src/config/get.js @@ -2,6 +2,7 @@ 'use strict' const { getDescribe, getIt, expect } = require('../utils/mocha') +const isPlainObject = require('is-plain-object') module.exports = (createCommon, options) => { const describe = getDescribe(options) @@ -32,7 +33,8 @@ module.exports = (createCommon, options) => { it('should retrieve the whole config', (done) => { ipfs.config.get((err, config) => { expect(err).to.not.exist() - expect(config).to.exist() + expect(config).to.be.an('object') + expect(isPlainObject(config)).to.be.true done() }) }) @@ -40,7 +42,8 @@ module.exports = (createCommon, options) => { it('should retrieve the whole config (promised)', () => { return ipfs.config.get() .then((config) => { - expect(config).to.exist() + expect(config).to.be.an('object') + expect(isPlainObject(config)).to.be.true }) }) diff --git a/package.json b/package.json index 0965155a..694dcb7f 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,9 @@ "peer-id": "~0.11.0", "peer-info": "~0.14.1", "pull-stream": "^3.6.8", - "pump": "^3.0.0" + "pump": "^3.0.0", + "is-plain-object": "^2.0.4" }, - "devDependencies": {}, "contributors": [ "Alan Shaw ", "Alex Potsides ", From 24db1946aec8fa2e3e5191eefae6797323d4c684 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Mon, 6 Aug 2018 11:12:00 +0100 Subject: [PATCH 2/2] fix: linting License: MIT Signed-off-by: Henrique Dias --- js/src/config/get.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/config/get.js b/js/src/config/get.js index c5d8500c..bedb5001 100644 --- a/js/src/config/get.js +++ b/js/src/config/get.js @@ -34,7 +34,7 @@ module.exports = (createCommon, options) => { ipfs.config.get((err, config) => { expect(err).to.not.exist() expect(config).to.be.an('object') - expect(isPlainObject(config)).to.be.true + expect(isPlainObject(config)).to.equal(true) done() }) }) @@ -43,7 +43,7 @@ module.exports = (createCommon, options) => { return ipfs.config.get() .then((config) => { expect(config).to.be.an('object') - expect(isPlainObject(config)).to.be.true + expect(isPlainObject(config)).to.equal(true) }) })