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

fix: increase timeout for name.publish and fix setup code #749

Merged
merged 1 commit into from
Apr 26, 2018
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
25 changes: 10 additions & 15 deletions test/name.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('.name', () => {
let other
let otherd
let name
let testFileCid

before(function (done) {
this.timeout(20 * 1000)
Expand Down Expand Up @@ -48,6 +49,13 @@ describe('.name', () => {
const ma = id.addresses[0]
other.swarm.connect(ma, cb)
})
},
(cb) => {
ipfs.files.add(testfile, (err, res) => {
expect(err).to.not.exist()
testFileCid = res[0].hash
cb()
})
}
], done)
})
Expand All @@ -59,23 +67,10 @@ describe('.name', () => {
], done)
})

it('add file for testing', (done) => {
const expectedMultihash = 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'

ipfs.files.add(testfile, (err, res) => {
expect(err).to.not.exist()

expect(res).to.have.length(1)
expect(res[0].hash).to.equal(expectedMultihash)
expect(res[0].path).to.equal(expectedMultihash)
done()
})
})

it('.name.publish', function (done) {
this.timeout(100 * 1000)
this.timeout(5 * 60 * 1000)

ipfs.name.publish('Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP', (err, res) => {
ipfs.name.publish(testFileCid, (err, res) => {
expect(err).to.not.exist()
name = res
expect(name).to.exist()
Expand Down