Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 41756b9

Browse files
vmxAlan Shaw
authored andcommitted
test: update ipfsd-ctl (#2368)
This new version of ipfsd-ctl is using async/await instead of callbacks. Hence some rather mechanical changes are needed for tests.
1 parent dd17ecb commit 41756b9

39 files changed

+606
-791
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
include:
2626
- stage: check
2727
script:
28-
- npx aegir build --bundlesize
28+
# https://bundlesize-store.now.sh/values?repo=ipfs/js-ipfs&token=[secure] is 500ing
29+
# - npx aegir build --bundlesize
2930
- npx aegir dep-check -- -i wrtc -i electron-webrtc
3031
- npm run lint
3132

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
"form-data": "^2.5.1",
193193
"hat": "0.0.3",
194194
"interface-ipfs-core": "^0.110.0",
195-
"ipfsd-ctl": "^0.43.0",
195+
"ipfsd-ctl": "^0.44.1",
196196
"libp2p-websocket-star": "~0.10.2",
197197
"ncp": "^2.0.0",
198198
"p-event": "^4.1.0",

test/bootstrapers.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const chai = require('chai')
5-
const dirtyChai = require('dirty-chai')
6-
const expect = chai.expect
7-
chai.use(dirtyChai)
84
const IPFS = require('..')
95
const IPFSFactory = require('ipfsd-ctl')
106
const bootstrapList = require('../src/core/runtime/config-browser.js')().Bootstrap
@@ -17,25 +13,21 @@ const waitFor = require('./utils/wait-for')
1713
describe('Check that a js-ipfs node can indeed contact the bootstrappers', () => {
1814
let ipfsd
1915

20-
before(function (done) {
16+
before(async () => {
2117
this.timeout(30 * 1000)
2218

2319
const factory = IPFSFactory.create({ type: 'proc', exec: IPFS })
2420

25-
factory.spawn({
21+
ipfsd = await factory.spawn({
2622
config: {
2723
Addresses: {
2824
Swarm: []
2925
}
3026
}
31-
}, (err, node) => {
32-
expect(err).to.not.exist()
33-
ipfsd = node
34-
done()
3527
})
3628
})
3729

38-
after(done => ipfsd.stop(done))
30+
after(() => ipfsd.stop())
3931

4032
it('a node connects to bootstrappers', function (done) {
4133
this.timeout(2 * 60 * 1000)

0 commit comments

Comments
 (0)