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

Commit e96107b

Browse files
committed
wip
1 parent 6db3fb8 commit e96107b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"test:interop": "IPFS_TEST=interop aegir test -t node -t browser -f test/interop",
3737
"test:interop:node": "IPFS_TEST=interop aegir test -t node -f test/interop/node.js",
3838
"test:interop:browser": "IPFS_TEST=interop aegir test -t browser -f test/interop/browser.js",
39+
"test:bootstrapers": "aegir test -t browser -f test/bootstrapers.js",
3940
"test:benchmark": "echo \"Error: no benchmarks yet\" && exit 1",
4041
"test:benchmark:node": "echo \"Error: no benchmarks yet\" && exit 1",
4142
"test:benchmark:node:core": "echo \"Error: no benchmarks yet\" && exit 1",

test/core/bootstrapers.spec.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* eslint-env mocha */
2+
'use strict'
3+
4+
const chai = require('chai')
5+
const dirtyChai = require('dirty-chai')
6+
const expect = chai.expect
7+
chai.use(dirtyChai)
8+
const IPFS = require('../..')
9+
10+
/*
11+
* These tests were graciously made for lgierth, so that he can test
12+
* the WebSockets Bootstrappers easily :)
13+
*/
14+
console.log('=>', process.env.TEST_BOOTSTRAPERS)
15+
if (process.env.TEST_BOOTSTRAPERS) {
16+
describe.only('Check if a connection can be done to the Bootstrapers', () => {
17+
it('a node connects to bootstrapers', (done) => {
18+
const node = new IPFS()
19+
node.on('ready', () => {
20+
setTimeout(() => {
21+
node.swarm.peers((err, peers) => {
22+
expect(err).to.not.exist()
23+
expect(peers.length).to.be.above(7)
24+
node.stop(done)
25+
})
26+
}, 1000)
27+
})
28+
})
29+
30+
it.skip('bootstrapers connections hold for more than 10 secs', (done) => {})
31+
it.skip('fetch a file added in this node, from bootstrapers', (done) => {})
32+
})
33+
}

0 commit comments

Comments
 (0)