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

tests: add stats and update interface-ipfs-core #1189

Merged
merged 2 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"form-data": "^2.3.1",
"go-ipfs-dep": "^0.4.13",
"hat": "0.0.3",
"interface-ipfs-core": "~0.41.0",
"interface-ipfs-core": "~0.42.1",
"ipfsd-ctl": "^0.27.0",
"left-pad": "^1.2.0",
"lodash": "^4.17.4",
Expand Down
1 change: 1 addition & 0 deletions test/core/interface/interface.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('interface-ipfs-core tests', () => {
require('./generic')
require('./object')
require('./dag')
require('./stats')
if (isNode) {
require('./swarm')
require('./pubsub')
Expand Down
33 changes: 33 additions & 0 deletions test/core/interface/stats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* eslint-env mocha */
'use strict'

const test = require('interface-ipfs-core')
const parallel = require('async/parallel')

const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ type: 'proc', exec: IPFS })

const nodes = []
const common = {
setup: function (callback) {
callback(null, {
spawnNode: (cb) => {
df.spawn((err, _ipfsd) => {
if (err) {
return cb(err)
}

nodes.push(_ipfsd)
cb(null, _ipfsd.api)
})
}
})
},
teardown: function (callback) {
parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
}
}

test.stats(common)