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

Commit 540a263

Browse files
committed
name.publish and name.resolve tests
1 parent 58d2d83 commit 540a263

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

test/tests.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,42 @@ describe('IPFS Node.js API wrapper tests', function () {
533533
})
534534

535535
describe('.log', function () {
536-
it('.log.tail')
536+
// TODO news 0.3.9 ndjson stuff
537+
it.skip('.log.tail', function (done) {
538+
apiClients['a'].log.tail(function (err, res) {
539+
if (err) {
540+
throw err
541+
}
542+
543+
console.log('->', res)
544+
done()
545+
})
546+
})
537547
})
538548

539549
describe('.name', function () {
540-
it('.name.publish')
541-
it('.name.resolve')
550+
var name
551+
it('.name.publish', function (done) {
552+
apiClients['a'].name.publish('Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP', function (err, res) {
553+
if (err) {
554+
throw err
555+
}
556+
assert(res)
557+
name = res
558+
done()
559+
})
560+
})
561+
it('.name.resolve', function (done) {
562+
apiClients['a'].name.resolve(name.Name, function (err, res) {
563+
if (err) {
564+
throw err
565+
}
566+
567+
assert(res)
568+
assert.deepEqual(res, { Path: '/ipfs/' + name.Value })
569+
done()
570+
})
571+
})
542572
})
543573

544574
if (isNode) {

0 commit comments

Comments
 (0)