This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 109
109
"browser-process-platform" : " ~0.1.1" ,
110
110
"cross-env" : " ^6.0.0" ,
111
111
"go-ipfs-dep" : " ^0.4.22" ,
112
- "interface-ipfs-core" : " ^0.119.0 " ,
112
+ "interface-ipfs-core" : " github:ipfs/interface-js-ipfs-core#test/add-human-option-test-repo-stat " ,
113
113
"ipfsd-ctl" : " ^0.47.1" ,
114
114
"nock" : " ^11.4.0" ,
115
115
"stream-equal" : " ^1.1.1"
Original file line number Diff line number Diff line change 3
3
const promisify = require ( 'promisify-es6' )
4
4
const Big = require ( 'bignumber.js' )
5
5
6
- const transform = function ( res , callback ) {
6
+ const transform = ( { human } ) => ( res , callback ) => {
7
7
callback ( null , {
8
- numObjects : new Big ( res . NumObjects ) ,
9
- repoSize : new Big ( res . RepoSize ) ,
8
+ numObjects : human ? res . NumObjects : new Big ( res . NumObjects ) ,
9
+ repoSize : human ? res . RepoSize : new Big ( res . RepoSize ) ,
10
10
repoPath : res . RepoPath ,
11
11
version : res . Version ,
12
- storageMax : new Big ( res . StorageMax )
12
+ storageMax : human ? res . StorageMax : new Big ( res . StorageMax )
13
13
} )
14
14
}
15
15
@@ -23,6 +23,6 @@ module.exports = (send) => {
23
23
send . andTransform ( {
24
24
path : 'repo/stat' ,
25
25
qs : opts
26
- } , transform , callback )
26
+ } , transform ( opts ) , callback )
27
27
} )
28
28
}
Original file line number Diff line number Diff line change @@ -247,7 +247,14 @@ describe('interface-ipfs-core tests', () => {
247
247
] : null
248
248
} )
249
249
250
- tests . repo ( defaultCommonFactory )
250
+ tests . repo ( defaultCommonFactory , {
251
+ skip : [
252
+ {
253
+ name : 'should get human readable repo stats' ,
254
+ reason : 'FIXME go-ipfs only has human option implemented for the cli'
255
+ }
256
+ ]
257
+ } )
251
258
252
259
tests . stats ( defaultCommonFactory )
253
260
You can’t perform that action at this time.
0 commit comments