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

test: add test for config set with number #470

Merged
merged 1 commit into from
May 15, 2019
Merged
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
13 changes: 13 additions & 0 deletions src/config/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down