@@ -24,41 +24,33 @@ module.exports = (common) => {
24
24
} )
25
25
26
26
describe ( 'callback API' , ( ) => {
27
- describe ( '.get' , ( done ) => {
28
- it ( 'errors when getting a non-existent key from the DHT' , ( done ) => {
29
- ipfs . dht . get ( 'non-existing' , { timeout : '100ms' } , ( err , value ) => {
30
- expect ( err ) . to . be . an . instanceof ( Error )
31
- done ( )
32
- } )
27
+ it ( '.get errors when getting a non-existent key from the DHT' , ( done ) => {
28
+ ipfs . dht . get ( 'non-existing' , { timeout : '100ms' } , ( err , value ) => {
29
+ expect ( err ) . to . be . an . instanceof ( Error )
30
+ done ( )
33
31
} )
34
32
} )
35
- describe ( '.findprovs' , ( ) => {
36
- it ( 'finds providers' , ( done ) => {
37
- ipfs . dht . findprovs ( 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP' , ( err , res ) => {
38
- expect ( err ) . to . not . exist
33
+ it ( '.findprovs' , ( done ) => {
34
+ ipfs . dht . findprovs ( 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP' , ( err , res ) => {
35
+ expect ( err ) . to . not . exist
39
36
40
- expect ( res ) . to . be . an ( 'array' )
41
- done ( )
42
- } )
37
+ expect ( res ) . to . be . an ( 'array' )
38
+ done ( )
43
39
} )
44
40
} )
45
41
} )
46
42
describe ( 'promise API' , ( ) => {
47
- describe ( '.get' , ( done ) => {
48
- it ( 'errors when getting a non-existent key from the DHT' , ( done ) => {
49
- ipfs . dht . get ( 'non-existing' , { timeout : '100ms' } ) . catch ( ( err ) => {
50
- expect ( err ) . to . be . an . instanceof ( Error )
51
- done ( )
52
- } )
43
+ it ( '.get errors when getting a non-existent key from the DHT' , ( done ) => {
44
+ ipfs . dht . get ( 'non-existing' , { timeout : '100ms' } ) . catch ( ( err ) => {
45
+ expect ( err ) . to . be . an . instanceof ( Error )
46
+ done ( )
53
47
} )
54
48
} )
55
- describe ( '.findprovs' , ( ) => {
56
- it ( 'finds providers' , ( done ) => {
57
- ipfs . dht . findprovs ( 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP' ) . then ( ( res ) => {
58
- expect ( res ) . to . be . an ( 'array' )
59
- done ( )
60
- } ) . catch ( done )
61
- } )
49
+ it ( '.findprovs' , ( done ) => {
50
+ ipfs . dht . findprovs ( 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP' ) . then ( ( res ) => {
51
+ expect ( res ) . to . be . an ( 'array' )
52
+ done ( )
53
+ } ) . catch ( done )
62
54
} )
63
55
} )
64
56
// Tests below are tests that haven't been implemented yet or is not
@@ -79,19 +71,17 @@ module.exports = (common) => {
79
71
} )
80
72
} )
81
73
} )
82
- xdescribe ( '.put & .get' , ( ) => {
83
- it ( 'puts and gets a key value pair in the DHT' , ( done ) => {
84
- peers . a . ipfs . dht . put ( 'scope' , 'interplanetary' , ( err , res ) => {
85
- expect ( err ) . to . not . exist
74
+ xit ( '.put and .get a key value pair in the DHT' , ( done ) => {
75
+ peers . a . ipfs . dht . put ( 'scope' , 'interplanetary' , ( err , res ) => {
76
+ expect ( err ) . to . not . exist
86
77
87
- expect ( res ) . to . be . an ( 'array' )
78
+ expect ( res ) . to . be . an ( 'array' )
88
79
89
- // bug: https://github.com/ipfs/go-ipfs/issues/1923#issuecomment-152932234
90
- peers . b . ipfs . dht . get ( 'scope' , ( err , value ) => {
91
- expect ( err ) . to . not . exist
92
- expect ( value ) . to . be . equal ( 'interplanetary' )
93
- done ( )
94
- } )
80
+ // bug: https://github.com/ipfs/go-ipfs/issues/1923#issuecomment-152932234
81
+ peers . b . ipfs . dht . get ( 'scope' , ( err , value ) => {
82
+ expect ( err ) . to . not . exist
83
+ expect ( value ) . to . be . equal ( 'interplanetary' )
84
+ done ( )
95
85
} )
96
86
} )
97
87
} )
0 commit comments