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

Commit 23fc213

Browse files
hacdiasJonKrone
authored andcommitted
tests: add stats and update interface-ipfs-core (#1189)
* tests: add stats and update interface-ipfs-core * chore: update interface-ipfs-core
1 parent 62fd639 commit 23fc213

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"form-data": "^2.3.1",
7474
"go-ipfs-dep": "^0.4.13",
7575
"hat": "0.0.3",
76-
"interface-ipfs-core": "~0.41.0",
76+
"interface-ipfs-core": "~0.42.1",
7777
"ipfsd-ctl": "^0.27.0",
7878
"left-pad": "^1.2.0",
7979
"lodash": "^4.17.4",

Diff for: test/core/interface/interface.spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ describe('interface-ipfs-core tests', () => {
1111
require('./generic')
1212
require('./object')
1313
require('./dag')
14+
require('./stats')
1415
if (isNode) {
1516
require('./swarm')
1617
require('./pubsub')

Diff for: test/core/interface/stats.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* eslint-env mocha */
2+
'use strict'
3+
4+
const test = require('interface-ipfs-core')
5+
const parallel = require('async/parallel')
6+
7+
const IPFS = require('../../../src')
8+
9+
const DaemonFactory = require('ipfsd-ctl')
10+
const df = DaemonFactory.create({ type: 'proc', exec: IPFS })
11+
12+
const nodes = []
13+
const common = {
14+
setup: function (callback) {
15+
callback(null, {
16+
spawnNode: (cb) => {
17+
df.spawn((err, _ipfsd) => {
18+
if (err) {
19+
return cb(err)
20+
}
21+
22+
nodes.push(_ipfsd)
23+
cb(null, _ipfsd.api)
24+
})
25+
}
26+
})
27+
},
28+
teardown: function (callback) {
29+
parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
30+
}
31+
}
32+
33+
test.stats(common)

0 commit comments

Comments
 (0)