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