mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Use js-ipfs only in tests
This commit is contained in:
@@ -1,36 +1,34 @@
|
||||
import { strictEqual, deepStrictEqual } from 'assert'
|
||||
import rmrf from 'rimraf'
|
||||
import * as IPFS from 'ipfs'
|
||||
import { OrbitDB } from '../src/index.js'
|
||||
import { config, startIpfs, stopIpfs } from 'orbit-db-test-utils'
|
||||
import config from './config.js'
|
||||
import connectPeers from './utils/connect-nodes.js'
|
||||
import waitFor from './utils/wait-for.js'
|
||||
|
||||
const IPFS = 'js-ipfs'
|
||||
|
||||
describe('Replicating databases', function () {
|
||||
this.timeout(60000)
|
||||
|
||||
let ipfsd1, ipfsd2
|
||||
let ipfs1, ipfs2
|
||||
let orbitdb1, orbitdb2
|
||||
|
||||
before(async () => {
|
||||
ipfsd1 = await startIpfs(IPFS, config.daemon1)
|
||||
ipfsd2 = await startIpfs(IPFS, config.daemon2)
|
||||
ipfs1 = ipfsd1.api
|
||||
ipfs2 = ipfsd2.api
|
||||
ipfs1 = await IPFS.create({ ...config.daemon1, repo: './ipfs1' })
|
||||
ipfs2 = await IPFS.create({ ...config.daemon2, repo: './ipfs2' })
|
||||
await connectPeers(ipfs1, ipfs2)
|
||||
})
|
||||
|
||||
after(async () => {
|
||||
if (ipfsd1) {
|
||||
await stopIpfs(ipfsd1)
|
||||
if (ipfs1) {
|
||||
await ipfs1.stop()
|
||||
}
|
||||
if (ipfsd2) {
|
||||
await stopIpfs(ipfsd2)
|
||||
if (ipfs2) {
|
||||
await ipfs2.stop()
|
||||
}
|
||||
await rmrf('./orbitdb1')
|
||||
await rmrf('./orbitdb2')
|
||||
await rmrf('./ipfs1')
|
||||
await rmrf('./ipfs2')
|
||||
})
|
||||
|
||||
describe('replicating a database', () => {
|
||||
|
||||
Reference in New Issue
Block a user