Skip to content

Commit 2bb5dd7

Browse files
committed
Add test
1 parent 9f1a24c commit 2bb5dd7

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

test/index.spec.js

+28-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,32 @@ describe('ipfs executable path', function () {
5353
})
5454
})
5555

56+
describe('local daemon', function () {
57+
const repoPath = '/tmp/ipfsd-ctl-test'
58+
const addr = '/ip4/127.0.0.1/tcp/5678'
59+
const config = {
60+
Addresses: {
61+
API: addr
62+
}
63+
}
64+
65+
it('allows passing flags to init', (done) => {
66+
ipfsd.local(repoPath, config, (err, node) => {
67+
assert.equal(err, null)
68+
69+
node.init((err) => {
70+
assert.equal(err, null)
71+
72+
node.getConfig('Addresses.API', (err, res) => {
73+
assert.equal(err, null)
74+
assert.equal(res, addr)
75+
rimraf(repoPath, done)
76+
})
77+
})
78+
})
79+
})
80+
})
81+
5682
describe('disposable node with local api', function () {
5783
this.timeout(20000)
5884
let ipfs
@@ -345,8 +371,9 @@ describe('ipfs-api version', function () {
345371
})
346372
})
347373

374+
// NOTE: if you change ./fixtures, the hash will need to be changed
348375
it('uses the correct ipfs-api', (done) => {
349-
ipfs.util.addFromFs(path.join(__dirname, 'fixtures'), { recursive: true }, (err, res) => {
376+
ipfs.util.addFromFs(path.join(__dirname, 'fixtures/'), { recursive: true }, (err, res) => {
350377
if (err) throw err
351378

352379
const added = res[res.length - 1]

0 commit comments

Comments
 (0)