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

Commit 18494a1

Browse files
committed
wip
1 parent 8735a08 commit 18494a1

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"test:interop": "npm run test:interop:node",
3333
"test:interop:node": "mocha -t 60000 test/interop/node.js",
3434
"test:interop:browser": "mocha -t 60000 test/interop/browser.js",
35+
"test:bootstrapers": "TEST_BOOTSTRAPERS=1 gulp test:browser",
3536
"test:benchmark": "echo \"Error: no benchmarks yet\" && exit 1",
3637
"test:benchmark:node": "echo \"Error: no benchmarks yet\" && exit 1",
3738
"test:benchmark:node:core": "echo \"Error: no benchmarks yet\" && exit 1",

test/core/bootstrapers.spec.js

Lines changed: 33 additions & 0 deletions
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)