Created
April 25, 2018 18:36
-
-
Save travisperson/f2eeb8e20be1e88a0a8f45a4869a4896 to your computer and use it in GitHub Desktop.
Running `interface-ipfs-core` agasint an `go-ipfs` implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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