Skip to content

Instantly share code, notes, and snippets.

@travisperson
Created April 25, 2018 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travisperson/f2eeb8e20be1e88a0a8f45a4869a4896 to your computer and use it in GitHub Desktop.
Save travisperson/f2eeb8e20be1e88a0a8f45a4869a4896 to your computer and use it in GitHub Desktop.
Running `interface-ipfs-core` agasint an `go-ipfs` implementation
const test = require('interface-ipfs-core')
const parallel = require('async/parallel')
const DaemonFactory = require('ipfsd-ctl')
const nodes = []
const common = {
setup: function (callback) {
const df = DaemonFactory.create()
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.block(common)
test.dht(common)
{
"name": "interface-golang-test",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"test": "env IPFS_GO_EXEC=$(which ipfs) yarn run aegir test -t node -f interface.spec.js"
},
"dependencies": {
"aegir": "^13.1.0",
"interface-ipfs-core": "^0.64.2",
"ipfsd-ctl": "^0.32.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment