mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
33 lines
800 B
JavaScript
33 lines
800 B
JavaScript
import * as IPFS from '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
|
|
const 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) }
|
|
|
|
export {
|
|
testAPIs
|
|
}
|