|
4 | 4 | const expect = require('chai').expect
|
5 | 5 | const runOn = require('../utils/on-and-off').on
|
6 | 6 |
|
7 |
| -describe('bitswap', function () { |
8 |
| - runOn((thing) => { |
9 |
| - this.timeout(30000) |
10 |
| - let ipfs |
11 |
| - const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR' |
| 7 | +describe('bitswap', () => runOn((thing) => { |
| 8 | + let ipfs |
| 9 | + const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR' |
12 | 10 |
|
13 |
| - before((done) => { |
14 |
| - ipfs = thing.ipfs |
15 |
| - ipfs('block get ' + key) |
16 |
| - .then(() => {}) |
17 |
| - .catch(() => {}) |
18 |
| - setTimeout(done, 800) |
19 |
| - }) |
| 11 | + before((done) => { |
| 12 | + ipfs = thing.ipfs |
| 13 | + ipfs('block get ' + key) |
| 14 | + .then(() => {}) |
| 15 | + .catch(() => {}) |
| 16 | + setTimeout(done, 800) |
| 17 | + }) |
20 | 18 |
|
21 |
| - it('wantlist', () => { |
22 |
| - return ipfs('bitswap wantlist').then((out) => { |
23 |
| - expect(out).to.eql(key + '\n') |
24 |
| - }) |
| 19 | + it('wantlist', function () { |
| 20 | + this.timeout(20 * 1000) |
| 21 | + return ipfs('bitswap wantlist').then((out) => { |
| 22 | + expect(out).to.eql(key + '\n') |
25 | 23 | })
|
| 24 | + }) |
| 25 | + |
| 26 | + it('stat', function () { |
| 27 | + this.timeout(20 * 1000) |
26 | 28 |
|
27 |
| - it('stat', () => { |
28 |
| - return ipfs('bitswap stat').then((out) => { |
29 |
| - expect(out).to.be.eql([ |
30 |
| - 'bitswap status', |
31 |
| - ' blocks received: 0', |
32 |
| - ' dup blocks received: 0', |
33 |
| - ' dup data received: 0B', |
34 |
| - ' wantlist [1 keys]', |
35 |
| - ` ${key}`, |
36 |
| - ' partners [0]', |
37 |
| - ' ' |
38 |
| - ].join('\n') + '\n') |
39 |
| - }) |
| 29 | + return ipfs('bitswap stat').then((out) => { |
| 30 | + expect(out).to.be.eql([ |
| 31 | + 'bitswap status', |
| 32 | + ' blocks received: 0', |
| 33 | + ' dup blocks received: 0', |
| 34 | + ' dup data received: 0B', |
| 35 | + ' wantlist [1 keys]', |
| 36 | + ` ${key}`, |
| 37 | + ' partners [0]', |
| 38 | + ' ' |
| 39 | + ].join('\n') + '\n') |
40 | 40 | })
|
41 | 41 | })
|
42 |
| -}) |
| 42 | +})) |
0 commit comments