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

Commit

Permalink
fix: expect config to be an object (#344)
Browse files Browse the repository at this point in the history
* fix: expect config to be an object

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

* fix: linting

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
  • Loading branch information
hacdias authored and alanshaw committed Aug 6, 2018
1 parent 3e972d2 commit eca00b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions js/src/config/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -32,15 +33,17 @@ 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.equal(true)
done()
})
})

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.equal(true)
})
})

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <alan@tableflip.io>",
"Alex Potsides <alex@achingbrain.net>",
Expand Down

0 comments on commit eca00b9

Please sign in to comment.