This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const promisify = require ( 'promisify-es6' )
4
4
const setImmediate = require ( 'async/setImmediate' )
5
+ const pkgversion = require ( '../../../package.json' ) . version
5
6
6
7
module . exports = function id ( self ) {
7
8
return promisify ( ( opts , callback ) => {
@@ -18,7 +19,7 @@ module.exports = function id (self) {
18
19
. map ( ( ma ) => ma . toString ( ) )
19
20
. filter ( ( ma ) => ma . indexOf ( 'ipfs' ) >= 0 )
20
21
. sort ( ) ,
21
- agentVersion : ' js-ipfs' ,
22
+ agentVersion : ` js-ipfs/ ${ pkgversion } ` ,
22
23
protocolVersion : '9000'
23
24
} ) )
24
25
} )
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ module.exports = (ctl) => {
13
13
expect ( err ) . to . not . exist ( )
14
14
expect ( result . id ) . to . equal ( idResult . ID )
15
15
expect ( result . publicKey ) . to . equal ( idResult . PublicKey )
16
- expect ( result . agentVersion ) . to . equal ( idResult . AgentVersion )
16
+ const agentComponents = result . agentVersion . split ( '/' )
17
+ expect ( agentComponents ) . lengthOf . above ( 1 )
18
+ expect ( agentComponents [ 0 ] ) . to . equal ( idResult . AgentVersion )
17
19
expect ( result . protocolVersion ) . to . equal ( idResult . ProtocolVersion )
18
20
done ( )
19
21
} )
Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ module.exports = (http) => {
18
18
} , ( res ) => {
19
19
expect ( res . result . ID ) . to . equal ( idResult . ID )
20
20
expect ( res . result . PublicKey ) . to . equal ( idResult . PublicKey )
21
- expect ( res . result . AgentVersion ) . to . equal ( idResult . AgentVersion )
21
+ const agentComponents = res . result . AgentVersion . split ( '/' )
22
+ expect ( agentComponents ) . lengthOf . above ( 1 )
23
+ expect ( agentComponents [ 0 ] ) . to . equal ( idResult . AgentVersion )
22
24
expect ( res . result . ProtocolVersion ) . to . equal ( idResult . ProtocolVersion )
23
25
done ( )
24
26
} )
You can’t perform that action at this time.
0 commit comments