Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 6d4efa4

Browse files
committed
fix: expect config to be an object
License: MIT Signed-off-by: Henrique Dias <[email protected]>
1 parent ff12e7e commit 6d4efa4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

js/src/config/get.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
'use strict'
33

44
const { getDescribe, getIt, expect } = require('../utils/mocha')
5+
const isPlainObject = require('is-plain-object')
56

67
module.exports = (createCommon, options) => {
78
const describe = getDescribe(options)
@@ -32,15 +33,16 @@ module.exports = (createCommon, options) => {
3233
it('should retrieve the whole config', (done) => {
3334
ipfs.config.get((err, config) => {
3435
expect(err).to.not.exist()
35-
expect(config).to.exist()
36+
expect(isPlainObject(config)).to.be.true
3637
done()
3738
})
3839
})
3940

4041
it('should retrieve the whole config (promised)', () => {
4142
return ipfs.config.get()
4243
.then((config) => {
43-
expect(config).to.exist()
44+
expect(config).to.be.an('object')
45+
expect(isPlainObject(config)).to.be.true
4446
})
4547
})
4648

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
"peer-id": "~0.11.0",
5454
"peer-info": "~0.14.1",
5555
"pull-stream": "^3.6.8",
56-
"pump": "^3.0.0"
56+
"pump": "^3.0.0",
57+
"is-plain-object": "^2.0.4"
5758
},
58-
"devDependencies": {},
5959
"contributors": [
6060
"Alan Shaw <[email protected]>",
6161
"Alex Potsides <[email protected]>",

0 commit comments

Comments
 (0)