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 108
108
"browser-process-platform" : " ~0.1.1" ,
109
109
"cross-env" : " ^6.0.0" ,
110
110
"go-ipfs-dep" : " ^0.4.22" ,
111
- "interface-ipfs-core" : " ^0.117.2 " ,
111
+ "interface-ipfs-core" : " github:ipfs/interface-js-ipfs-core#test/add-human-option-test-repo-stat " ,
112
112
"ipfsd-ctl" : " ^0.47.1" ,
113
113
"nock" : " ^11.4.0" ,
114
114
"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 @@ -239,7 +239,14 @@ describe('interface-ipfs-core tests', () => {
239
239
] : null
240
240
} )
241
241
242
- tests . repo ( defaultCommonFactory )
242
+ tests . repo ( defaultCommonFactory , {
243
+ skip : [
244
+ {
245
+ name : 'should get human readable repo stats' ,
246
+ reason : 'FIXME go-ipfs only has human option implemented for the cli'
247
+ }
248
+ ]
249
+ } )
243
250
244
251
tests . stats ( defaultCommonFactory )
245
252
You can’t perform that action at this time.
0 commit comments