orbit-db/test/utils/test-apis.js
haad a2524688d2 Run tests with go-ipfs and js-ipfs-api again
Use go-ipfs 0.4.13 to run tests
Add write benchmark for go-ipfs
Clean up benchmarks
Fix a test not catching errors
2018-03-27 16:08:43 +02:00

34 lines
801 B
JavaScript

const IPFS = require('ipfs')
/**
* IPFS daemons to run the tests with.
*/
// Available daemon types are defined in:
// https://github.com/ipfs/js-ipfsd-ctl#ipfsfactory---const-f--ipfsfactorycreateoptions
let jsIpfs = {
'js-ipfs': {
type: 'proc',
exec: IPFS,
}
}
const goIpfs = {
'go-ipfs': {
type: 'go',
}
}
// By default, we run tests against js-ipfs.
let testAPIs = Object.assign({}, jsIpfs)
// Setting env variable 'TEST=all' will make tests run with js-ipfs and go-ipfs.
// Setting env variable 'TEST=go' will make tests run with go-ipfs.
// Eg. 'TEST=go mocha' runs tests with go-ipfs
if (process.env.TEST === 'all')
testAPIs = Object.assign({}, testAPIs, goIpfs)
else if (process.env.TEST === 'go')
testAPIs = Object.assign({}, goIpfs)
module.exports = testAPIs