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

Commit ceb1106

Browse files
alanshawdaviddias
authored andcommitted
fix: increase timeout for name.publish and fix setup code
1 parent f6f1bf0 commit ceb1106

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

test/name.spec.js

+10-15
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ describe('.name', () => {
2121
let other
2222
let otherd
2323
let name
24+
let testFileCid
2425

2526
before(function (done) {
2627
this.timeout(20 * 1000)
@@ -48,6 +49,13 @@ describe('.name', () => {
4849
const ma = id.addresses[0]
4950
other.swarm.connect(ma, cb)
5051
})
52+
},
53+
(cb) => {
54+
ipfs.files.add(testfile, (err, res) => {
55+
expect(err).to.not.exist()
56+
testFileCid = res[0].hash
57+
cb()
58+
})
5159
}
5260
], done)
5361
})
@@ -59,23 +67,10 @@ describe('.name', () => {
5967
], done)
6068
})
6169

62-
it('add file for testing', (done) => {
63-
const expectedMultihash = 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
64-
65-
ipfs.files.add(testfile, (err, res) => {
66-
expect(err).to.not.exist()
67-
68-
expect(res).to.have.length(1)
69-
expect(res[0].hash).to.equal(expectedMultihash)
70-
expect(res[0].path).to.equal(expectedMultihash)
71-
done()
72-
})
73-
})
74-
7570
it('.name.publish', function (done) {
76-
this.timeout(100 * 1000)
71+
this.timeout(5 * 60 * 1000)
7772

78-
ipfs.name.publish('Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP', (err, res) => {
73+
ipfs.name.publish(testFileCid, (err, res) => {
7974
expect(err).to.not.exist()
8075
name = res
8176
expect(name).to.exist()

0 commit comments

Comments
 (0)