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 +35
-1
lines changed
Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module.exports = (arg) => {
77
88 return {
99 gc : require ( './gc' ) ( send ) ,
10- stat : require ( './stat' ) ( send )
10+ stat : require ( './stat' ) ( send ) ,
11+ version : require ( './version' ) ( send )
1112 }
1213}
Original file line number Diff line number Diff line change 1+ 'use strict'
2+
3+ const promisify = require ( 'promisify-es6' )
4+
5+ module . exports = ( send ) => {
6+ return promisify ( ( opts , callback ) => {
7+ if ( typeof ( opts ) === 'function' ) {
8+ callback = opts
9+ opts = { }
10+ }
11+ send ( {
12+ path : 'repo/version' ,
13+ qs : opts
14+ } , callback )
15+ } )
16+ }
Original file line number Diff line number Diff line change @@ -46,6 +46,15 @@ describe('.repo', function () {
4646 done ( )
4747 } )
4848 } )
49+
50+ it ( '.repo.version' , ( done ) => {
51+ ipfs . repo . version ( ( err , res ) => {
52+ expect ( err ) . to . not . exist ( )
53+ expect ( res ) . to . exist ( )
54+ expect ( res ) . to . have . a . property ( 'Version' )
55+ done ( )
56+ } )
57+ } )
4958 } )
5059
5160 describe ( 'Promise API' , ( ) => {
@@ -61,5 +70,13 @@ describe('.repo', function () {
6170 expect ( res ) . to . have . a . property ( 'RepoSize' )
6271 } )
6372 } )
73+
74+ it ( '.repo.version' , ( ) => {
75+ return ipfs . repo . version ( )
76+ . then ( res => {
77+ expect ( res ) . to . exist ( )
78+ expect ( res ) . to . have . a . property ( 'Version' )
79+ } )
80+ } )
6481 } )
6582} )
You can’t perform that action at this time.
0 commit comments