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

fix: expect config to be an object #344

Merged
merged 2 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>",
"Alex Potsides <[email protected]>",
Expand Down