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

Commit 459a473

Browse files
test(http-api/interface): use bootstrap test
1 parent 2996ddd commit 459a473

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/http-api/interface/bootstrap.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* eslint-env mocha */
2+
'use strict'
3+
4+
const test = require('interface-ipfs-core')
5+
const parallel = require('async/parallel')
6+
7+
const DaemonFactory = require('ipfsd-ctl')
8+
const df = DaemonFactory.create({ exec: 'src/cli/bin.js' })
9+
10+
const nodes = []
11+
const common = {
12+
setup: function (callback) {
13+
callback(null, {
14+
spawnNode: (cb) => {
15+
df.spawn((err, _ipfsd) => {
16+
if (err) {
17+
return cb(err)
18+
}
19+
20+
nodes.push(_ipfsd)
21+
cb(null, _ipfsd.api)
22+
})
23+
}
24+
})
25+
},
26+
teardown: function (callback) {
27+
parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
28+
}
29+
}
30+
31+
test.bootstrap(common)

0 commit comments

Comments
 (0)