Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: new setup
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Sep 15, 2019
1 parent da79067 commit b724e65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/miscellaneous/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()

describe('.id', () => {
describe('.id', function () {
this.timeout(60 * 1000)
let ipfs

before(function (done) {
// CI takes longer to instantiate the daemon, so we need to increase the
// timeout for the before step
this.timeout(60 * 1000)

common.setup((err, factory) => {
expect(err).to.not.exist()
Expand Down
3 changes: 2 additions & 1 deletion src/miscellaneous/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()

describe('.resolve', () => {
describe('.resolve', function () {
this.timeout(60 * 1000)
let ipfs
let nodeId

Expand Down
26 changes: 6 additions & 20 deletions src/swarm/connect.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
/* eslint-env mocha */
'use strict'

const { spawnNodesWithId } = require('../utils/spawn')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const { getDescribe, getIt } = require('../utils/mocha')

module.exports = (createCommon, options) => {
const describe = getDescribe(options)
const it = getIt(options)
const common = createCommon()

describe('.swarm.connect', function () {
this.timeout(80 * 1000)

this.timeout(10000)
let ipfsA
let ipfsB

before(function (done) {
// CI takes longer to instantiate the daemon, so we need to increase the
// timeout for the before step
this.timeout(100 * 1000)

common.setup((err, factory) => {
expect(err).to.not.exist()

spawnNodesWithId(2, factory, (err, nodes) => {
expect(err).to.not.exist()
ipfsA = nodes[0]
ipfsB = nodes[1]
done()
})
})
before(async () => {
ipfsA = await common.setup()
ipfsB = await common.setup()
})

after((done) => common.teardown(done))
after(() => common.teardown())

it('should connect to a peer', (done) => {
ipfsA.swarm.connect(ipfsB.peerId.addresses[0], done)
Expand Down

0 comments on commit b724e65

Please sign in to comment.