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

fix: key.rm test #185

Merged
merged 1 commit into from
Dec 18, 2017
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
4 changes: 2 additions & 2 deletions src/key.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ module.exports = (common) => {
})

it('removes a key', function (done) {
ipfs.key.rm(key.name, (err, res) => {
ipfs.key.rm(key.Name, (err, res) => {
expect(err).to.not.exist()
expect(res).to.exist()
expect(res).to.have.property('Keys')
Expand All @@ -133,7 +133,7 @@ module.exports = (common) => {
it('does not contain the removed name', (done) => {
ipfs.key.list((err, res) => {
expect(err).to.not.exist()
const found = res.Keys.filter(k => k.Name === key.name)
const found = res.Keys.filter(k => k.Name === key.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't disagree with the lowercase .name. You can convert that in js-ipfs-api. It is friendlier to js devs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diasdavid go-ipfs returns Capitalised names. We must support it as is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine then

expect(found).to.have.length(0)
done()
})
Expand Down