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

Let bandwidth stats tests run on JS-IPFS #225

Merged
merged 1 commit into from
Mar 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions js/src/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,19 @@ module.exports = (common) => {
})

it('.bw', function (done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
this.skip()
}

ipfs.stats.bw((err, res) => {
statsTests.expectIsBandwidth(err, res)
done()
})
})

it('.bw Promise', function () {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
this.skip()
}

it('.bw Promise', () => {
return ipfs.stats.bw().then((res) => {
statsTests.expectIsBandwidth(null, res)
})
})

it('.bwReadableStream', function (done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
this.skip()
}

it('.bwReadableStream', (done) => {
const stream = ipfs.stats.bwReadableStream()

stream.once('data', (data) => {
Expand All @@ -89,12 +74,7 @@ module.exports = (common) => {
})
})

it('.bwPullStream', function (done) {
if (!withGo) {
console.log('Not supported in js-ipfs yet')
this.skip()
}

it('.bwPullStream', (done) => {
const stream = ipfs.stats.bwPullStream()

pull(
Expand Down