@@ -53,22 +53,22 @@ describe('.dht', () => {
53
53
} )
54
54
} )
55
55
56
- it ( 'should be able to dht.get a value from the DHT with a maxTimeout ' , ( done ) => {
56
+ it ( 'should be able to dht.get a value from the DHT with options ' , ( done ) => {
57
57
const key = Buffer . from ( '/v/hello' )
58
58
const value = Buffer . from ( 'world' )
59
59
60
60
nodeA . dht . put ( key , value , ( err ) => {
61
61
expect ( err ) . to . not . exist ( )
62
62
63
- nodeA . dht . get ( key , 3000 , ( err , res ) => {
63
+ nodeA . dht . get ( key , { maxTimeout : 3000 } , ( err , res ) => {
64
64
expect ( err ) . to . not . exist ( )
65
65
expect ( res ) . to . eql ( value )
66
66
done ( )
67
67
} )
68
68
} )
69
69
} )
70
70
71
- it ( 'should be able to dht.get a value from the DHT with no maxTimeout defined' , ( done ) => {
71
+ it ( 'should be able to dht.get a value from the DHT with no options defined' , ( done ) => {
72
72
const key = Buffer . from ( '/v/hello' )
73
73
const value = Buffer . from ( 'world' )
74
74
@@ -83,22 +83,22 @@ describe('.dht', () => {
83
83
} )
84
84
} )
85
85
86
- it ( 'should be able to dht.getMany a value from the DHT with a maxTimeout ' , ( done ) => {
86
+ it ( 'should be able to dht.getMany a value from the DHT with options ' , ( done ) => {
87
87
const key = Buffer . from ( '/v/hello' )
88
88
const value = Buffer . from ( 'world' )
89
89
90
90
nodeA . dht . put ( key , value , ( err ) => {
91
91
expect ( err ) . to . not . exist ( )
92
92
93
- nodeA . dht . getMany ( key , 1 , ( err , res ) => {
93
+ nodeA . dht . getMany ( key , 1 , { maxTimeout : 3000 } , ( err , res ) => {
94
94
expect ( err ) . to . not . exist ( )
95
95
expect ( res ) . to . exist ( )
96
96
done ( )
97
97
} )
98
98
} )
99
99
} )
100
100
101
- it ( 'should be able to dht.getMany a value from the DHT with no maxTimeout defined' , ( done ) => {
101
+ it ( 'should be able to dht.getMany a value from the DHT with no options defined' , ( done ) => {
102
102
const key = Buffer . from ( '/v/hello' )
103
103
const value = Buffer . from ( 'world' )
104
104
0 commit comments