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

Commit

Permalink
test(http-api/interface): use bootstrap test
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Feb 15, 2018
1 parent 2996ddd commit 459a473
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/http-api/interface/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-env mocha */
'use strict'

const test = require('interface-ipfs-core')
const parallel = require('async/parallel')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ exec: 'src/cli/bin.js' })

const nodes = []
const common = {
setup: function (callback) {
callback(null, {
spawnNode: (cb) => {
df.spawn((err, _ipfsd) => {
if (err) {
return cb(err)
}

nodes.push(_ipfsd)
cb(null, _ipfsd.api)
})
}
})
},
teardown: function (callback) {
parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
}
}

test.bootstrap(common)

0 comments on commit 459a473

Please sign in to comment.