orbitdb/test/utils/stop-ipfs.js
haad 3318b6a6d9 Use ipfsd-ctl to create test IPFS instances
Fix default database creation tests
Add more test utils
Remove obsolete public methods from OrbitDB
Workaround for "underlying socket has been closed" error in replication test
Update package-lock
2018-03-27 14:30:45 +02:00

18 lines
324 B
JavaScript

'use strict'
/**
* Stop an IPFS or ipfsd-ctl instance
* @param {Object} config [IPFS ipfsd-ctl to stop]
* @return {None}
*/
const stopIpfs = (ipfs) => {
return new Promise(async (resolve, reject) => {
ipfs.stop((err) => {
if (err) { reject(err) }
resolve()
})
})
}
module.exports = stopIpfs