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

Commit 719feed

Browse files
committed
c
1 parent bf5bfff commit 719feed

File tree

1 file changed

+34
-77
lines changed

1 file changed

+34
-77
lines changed

test/stats.spec.js

Lines changed: 34 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -26,88 +26,45 @@ describe('stats', function () {
2626

2727
after((done) => ipfsd.stop(done))
2828

29-
describe('Callback API', () => {
30-
it('.stats.bitswap', (done) => {
31-
ipfs.stats.bitswap((err, res) => {
32-
expect(err).to.not.exist()
33-
expect(res).to.exist()
34-
expect(res).to.have.a.property('provideBufLen')
35-
expect(res).to.have.a.property('wantlist')
36-
expect(res).to.have.a.property('peers')
37-
expect(res).to.have.a.property('blocksReceived')
38-
expect(res).to.have.a.property('dataReceived')
39-
expect(res).to.have.a.property('blocksSent')
40-
expect(res).to.have.a.property('dataSent')
41-
expect(res).to.have.a.property('dupBlksReceived')
42-
expect(res).to.have.a.property('dupDataReceived')
43-
done()
44-
})
45-
})
46-
47-
it('.stats.bw', (done) => {
48-
ipfs.stats.bw((err, res) => {
49-
expect(err).to.not.exist()
50-
expect(res).to.exist()
51-
expect(res).to.have.a.property('totalIn')
52-
expect(res).to.have.a.property('totalOut')
53-
expect(res).to.have.a.property('rateIn')
54-
expect(res).to.have.a.property('rateOut')
55-
done()
56-
})
57-
})
58-
59-
it('.stats.repo', (done) => {
60-
ipfs.stats.repo((err, res) => {
61-
expect(err).to.not.exist()
62-
expect(res).to.exist()
63-
expect(res).to.have.a.property('numObjects')
64-
expect(res).to.have.a.property('repoSize')
65-
expect(res).to.have.a.property('repoPath')
66-
expect(res).to.have.a.property('version')
67-
expect(res).to.have.a.property('storageMax')
68-
done()
69-
})
29+
it('.stats.bitswap', (done) => {
30+
ipfs.stats.bitswap((err, res) => {
31+
expect(err).to.not.exist()
32+
expect(res).to.exist()
33+
expect(res).to.have.a.property('provideBufLen')
34+
expect(res).to.have.a.property('wantlist')
35+
expect(res).to.have.a.property('peers')
36+
expect(res).to.have.a.property('blocksReceived')
37+
expect(res).to.have.a.property('dataReceived')
38+
expect(res).to.have.a.property('blocksSent')
39+
expect(res).to.have.a.property('dataSent')
40+
expect(res).to.have.a.property('dupBlksReceived')
41+
expect(res).to.have.a.property('dupDataReceived')
42+
done()
7043
})
7144
})
7245

73-
describe('Promise API', () => {
74-
it('.stats.bw', () => {
75-
return ipfs.stats.bw()
76-
.then((res) => {
77-
expect(res).to.exist()
78-
expect(res).to.have.a.property('totalIn')
79-
expect(res).to.have.a.property('totalOut')
80-
expect(res).to.have.a.property('rateIn')
81-
expect(res).to.have.a.property('rateOut')
82-
})
83-
})
84-
85-
it('.stats.repo', () => {
86-
return ipfs.stats.repo()
87-
.then((res) => {
88-
expect(res).to.exist()
89-
expect(res).to.have.a.property('numObjects')
90-
expect(res).to.have.a.property('repoSize')
91-
expect(res).to.have.a.property('repoPath')
92-
expect(res).to.have.a.property('version')
93-
expect(res).to.have.a.property('storageMax')
94-
})
46+
it('.stats.bw', (done) => {
47+
ipfs.stats.bw((err, res) => {
48+
expect(err).to.not.exist()
49+
expect(res).to.exist()
50+
expect(res).to.have.a.property('totalIn')
51+
expect(res).to.have.a.property('totalOut')
52+
expect(res).to.have.a.property('rateIn')
53+
expect(res).to.have.a.property('rateOut')
54+
done()
9555
})
56+
})
9657

97-
it('.stats.bitswap', () => {
98-
return ipfs.stats.bitswap()
99-
.then((res) => {
100-
expect(res).to.exist()
101-
expect(res).to.have.a.property('provideBufLen')
102-
expect(res).to.have.a.property('wantlist')
103-
expect(res).to.have.a.property('peers')
104-
expect(res).to.have.a.property('blocksReceived')
105-
expect(res).to.have.a.property('dataReceived')
106-
expect(res).to.have.a.property('blocksSent')
107-
expect(res).to.have.a.property('dataSent')
108-
expect(res).to.have.a.property('dupBlksReceived')
109-
expect(res).to.have.a.property('dupDataReceived')
110-
})
58+
it('.stats.repo', (done) => {
59+
ipfs.stats.repo((err, res) => {
60+
expect(err).to.not.exist()
61+
expect(res).to.exist()
62+
expect(res).to.have.a.property('numObjects')
63+
expect(res).to.have.a.property('repoSize')
64+
expect(res).to.have.a.property('repoPath')
65+
expect(res).to.have.a.property('version')
66+
expect(res).to.have.a.property('storageMax')
67+
done()
11168
})
11269
})
11370
})

0 commit comments

Comments
 (0)