@@ -34,7 +34,7 @@ module.exports = (common, options) => {
34
34
35
35
const result = await all ( ipfs . block . rm ( cid ) )
36
36
expect ( result ) . to . be . an ( 'array' ) . and . to . have . lengthOf ( 1 )
37
- expect ( result [ 0 ] ) . to . have . property ( 'hash' , cid . toString ( ) )
37
+ expect ( result [ 0 ] . cid . toString ( ) ) . equal ( cid . toString ( ) )
38
38
expect ( result [ 0 ] ) . to . not . have . property ( 'error' )
39
39
40
40
// did we actually remove the block?
@@ -51,7 +51,7 @@ module.exports = (common, options) => {
51
51
const result = await all ( ipfs . block . rm ( cid . toString ( ) ) )
52
52
53
53
expect ( result ) . to . be . an ( 'array' ) . and . to . have . lengthOf ( 1 )
54
- expect ( result [ 0 ] ) . to . have . property ( 'hash' , cid . toString ( ) )
54
+ expect ( result [ 0 ] . cid . toString ( ) ) . to . equal ( cid . toString ( ) )
55
55
expect ( result [ 0 ] ) . to . not . have . property ( 'error' )
56
56
} )
57
57
@@ -63,7 +63,7 @@ module.exports = (common, options) => {
63
63
const result = await all ( ipfs . block . rm ( cid . buffer ) )
64
64
65
65
expect ( result ) . to . be . an ( 'array' ) . and . to . have . lengthOf ( 1 )
66
- expect ( result [ 0 ] ) . to . have . property ( 'hash' , cid . toString ( ) )
66
+ expect ( result [ 0 ] . cid . toString ( ) ) . to . equal ( cid . toString ( ) )
67
67
expect ( result [ 0 ] ) . to . not . have . property ( 'error' )
68
68
} )
69
69
@@ -88,7 +88,7 @@ module.exports = (common, options) => {
88
88
expect ( result ) . to . be . an ( 'array' ) . and . to . have . lengthOf ( 3 )
89
89
90
90
result . forEach ( ( res , index ) => {
91
- expect ( res ) . to . have . property ( 'hash' , cids [ index ] . toString ( ) )
91
+ expect ( res . cid . toString ( ) ) . to . equal ( cids [ index ] . toString ( ) )
92
92
expect ( res ) . to . not . have . property ( 'error' )
93
93
} )
94
94
} )
@@ -106,7 +106,8 @@ module.exports = (common, options) => {
106
106
const result = await all ( ipfs . block . rm ( cid ) )
107
107
108
108
expect ( result ) . to . be . an ( 'array' ) . and . to . have . lengthOf ( 1 )
109
- expect ( result [ 0 ] ) . to . have . property ( 'error' ) . and . to . include ( 'block not found' )
109
+ expect ( result [ 0 ] ) . to . have . property ( 'error' )
110
+ expect ( result [ 0 ] . error . message ) . to . include ( 'block not found' )
110
111
} )
111
112
112
113
it ( 'should not error when force removing non-existent blocks' , async ( ) => {
@@ -122,7 +123,7 @@ module.exports = (common, options) => {
122
123
const result = await all ( ipfs . block . rm ( cid , { force : true } ) )
123
124
124
125
expect ( result ) . to . be . an ( 'array' ) . and . to . have . lengthOf ( 1 )
125
- expect ( result [ 0 ] ) . to . have . property ( 'hash' , cid . toString ( ) )
126
+ expect ( result [ 0 ] . cid . toString ( ) ) . to . equal ( cid . toString ( ) )
126
127
expect ( result [ 0 ] ) . to . not . have . property ( 'error' )
127
128
} )
128
129
@@ -146,7 +147,8 @@ module.exports = (common, options) => {
146
147
const result = await all ( ipfs . block . rm ( cid ) )
147
148
148
149
expect ( result ) . to . be . an ( 'array' ) . and . to . have . lengthOf ( 1 )
149
- expect ( result [ 0 ] ) . to . have . property ( 'error' ) . and . to . include ( 'pinned' )
150
+ expect ( result [ 0 ] ) . to . have . property ( 'error' )
151
+ expect ( result [ 0 ] . error . message ) . to . include ( 'pinned' )
150
152
} )
151
153
} )
152
154
}
0 commit comments