Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 287d7ae

Browse files
victorbachingbrain
authored andcommitted
test: add test for reading config from repo when using cli
License: MIT Signed-off-by: Victor Bjelkholm <[email protected]>
1 parent 26838e0 commit 287d7ae

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/cli/daemon.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,29 @@ describe('daemon', () => {
134134
done()
135135
})
136136
})
137+
138+
it('uses config from repo config', function () {
139+
this.timeout(100 * 1000)
140+
return ipfs('init').then(() => {
141+
return ipfs('config EXPERIMENTAL.pubsub true --bool')
142+
}).then(() => {
143+
const config = JSON.parse(fs.readFileSync(path.join(repoPath, 'config')))
144+
expect(config.EXPERIMENTAL.pubsub).to.equal(true)
145+
return ipfs('config EXPERIMENTAL.pubsub')
146+
}).then((out) => {
147+
expect(out.trim()).to.equal('true')
148+
const proc = ipfs('daemon')
149+
return new Promise((resolve, reject) => {
150+
proc.stdout.on('data', (data) => {
151+
if (data.toString().includes(`Daemon is ready`)) {
152+
resolve()
153+
}
154+
})
155+
})
156+
}).then(() => {
157+
return ipfs('pubsub ls')
158+
}).then((out) => {
159+
expect(out).to.equal('')
160+
})
161+
})
137162
})

0 commit comments

Comments
 (0)