@@ -46,8 +46,26 @@ module.exports = (common) => {
46
46
common . teardown ( done )
47
47
} )
48
48
49
- describe ( 'callback API' , ( ) => {
49
+ describe ( 'callback API' , function ( ) {
50
+ this . timeout ( 20 * 1000 )
50
51
// 1st, because ipfs.files.add pins automatically
52
+ it ( '.ls type recursive' , ( done ) => {
53
+ ipfs . pin . ls ( { type : 'recursive' } , ( err , pinset ) => {
54
+ expect ( err ) . to . not . exist
55
+ expect ( pinset ) . to . not . be . empty
56
+ done ( )
57
+ } )
58
+ } )
59
+
60
+ it ( '.ls type indirect' , ( done ) => {
61
+ ipfs . pin . ls ( { type : 'indirect' } , ( err , pinset ) => {
62
+ expect ( err ) . to . not . exist
63
+ // expect empty for now since the object has no links
64
+ expect ( pinset ) . to . be . empty
65
+ done ( )
66
+ } )
67
+ } )
68
+
51
69
it ( '.rm' , ( done ) => {
52
70
const hash = 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
53
71
@@ -67,7 +85,7 @@ module.exports = (common) => {
67
85
68
86
ipfs . pin . add ( hash , { recursive : false } , ( err , pinset ) => {
69
87
expect ( err ) . to . not . exist
70
- expect ( pinset [ 0 ] ) . to . be . equal ( hash )
88
+ expect ( pinset [ 0 ] . hash ) . to . be . equal ( hash )
71
89
done ( )
72
90
} )
73
91
} )
@@ -88,22 +106,6 @@ module.exports = (common) => {
88
106
} )
89
107
} )
90
108
91
- it ( '.ls type indirect' , ( done ) => {
92
- ipfs . pin . ls ( { type : 'indirect' } , ( err , pinset ) => {
93
- expect ( err ) . to . not . exist
94
- expect ( pinset ) . to . not . be . empty
95
- done ( )
96
- } )
97
- } )
98
-
99
- it ( '.ls type recursive' , ( done ) => {
100
- ipfs . pin . ls ( { type : 'recursive' } , ( err , pinset ) => {
101
- expect ( err ) . to . not . exist
102
- expect ( pinset ) . to . not . be . empty
103
- done ( )
104
- } )
105
- } )
106
-
107
109
it ( '.ls for a specific hash' , ( done ) => {
108
110
const hash = 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
109
111
@@ -121,7 +123,7 @@ module.exports = (common) => {
121
123
122
124
return ipfs . pin . add ( hash , { recursive : false } )
123
125
. then ( ( pinset ) => {
124
- expect ( pinset [ 0 ] ) . to . be . equal ( hash )
126
+ expect ( pinset [ 0 ] . hash ) . to . be . equal ( hash )
125
127
} )
126
128
} )
127
129
0 commit comments