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

Commit

Permalink
tests: add stats and update interface-ipfs-core (#1189)
Browse files Browse the repository at this point in the history
* tests: add stats and update interface-ipfs-core

* chore: update interface-ipfs-core
  • Loading branch information
hacdias authored and daviddias committed Jan 26, 2018
1 parent d16a129 commit cfa38ca
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
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)

0 comments on commit cfa38ca

Please sign in to comment.