@@ -50,9 +50,10 @@ module.exports = (common) => {
50
50
ipfs . files . add ( arr , ( err , res ) => {
51
51
expect ( err ) . to . not . exist
52
52
expect ( res ) . to . be . length ( 1 )
53
- expect ( res [ 0 ] . size ( ) ) . to . equal ( 17 )
53
+ expect ( res [ 0 ] . path ) . to . equal ( 'data.txt' )
54
+ expect ( res [ 0 ] . node . size ( ) ) . to . equal ( 17 )
54
55
const mh = 'QmVv4Wz46JaZJeH5PMV4LGbRiiMKEmszPYY3g6fjGnVXBS'
55
- expect ( bs58 . encode ( res [ 0 ] . multihash ( ) ) . toString ( ) ) . to . equal ( mh )
56
+ expect ( bs58 . encode ( res [ 0 ] . node . multihash ( ) ) . toString ( ) ) . to . equal ( mh )
56
57
done ( )
57
58
} )
58
59
} )
@@ -69,9 +70,10 @@ module.exports = (common) => {
69
70
expect ( err ) . to . not . exist
70
71
71
72
const added = res [ 0 ] != null ? res [ 0 ] : res
72
- const mh = bs58 . encode ( added . multihash ( ) ) . toString ( )
73
+ const mh = bs58 . encode ( added . node . multihash ( ) ) . toString ( )
73
74
expect ( mh ) . to . equal ( 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP' )
74
- expect ( added . links ) . to . have . length ( 0 )
75
+ expect ( added . path ) . to . equal ( 'testfile.txt' )
76
+ expect ( added . node . links ) . to . have . length ( 0 )
75
77
done ( )
76
78
} )
77
79
} )
@@ -82,9 +84,10 @@ module.exports = (common) => {
82
84
expect ( err ) . to . not . exist
83
85
84
86
expect ( res ) . to . have . length ( 1 )
85
- const mh = bs58 . encode ( res [ 0 ] . multihash ( ) ) . toString ( )
87
+ const mh = bs58 . encode ( res [ 0 ] . node . multihash ( ) ) . toString ( )
86
88
expect ( mh ) . to . equal ( 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP' )
87
- expect ( res [ 0 ] . links ) . to . have . length ( 0 )
89
+ expect ( res [ 0 ] . path ) . to . equal ( mh )
90
+ expect ( res [ 0 ] . node . links ) . to . have . length ( 0 )
88
91
done ( )
89
92
} )
90
93
} )
@@ -98,9 +101,9 @@ module.exports = (common) => {
98
101
expect ( err ) . to . not . exist
99
102
100
103
expect ( res ) . to . have . length ( 1 )
101
- const mh = bs58 . encode ( res [ 0 ] . multihash ( ) ) . toString ( )
104
+ const mh = bs58 . encode ( res [ 0 ] . node . multihash ( ) ) . toString ( )
102
105
expect ( mh ) . to . equal ( 'Qmcx5werSWQPdrGVap7LARHB4QUSPRPJwxhFuHvdoXqQXT' )
103
- expect ( res [ 0 ] . links ) . to . have . length ( 58 )
106
+ expect ( res [ 0 ] . node . links ) . to . have . length ( 58 )
104
107
done ( )
105
108
} )
106
109
} )
@@ -130,9 +133,10 @@ module.exports = (common) => {
130
133
expect ( err ) . to . not . exist
131
134
132
135
const added = res [ res . length - 1 ]
133
- const mh = bs58 . encode ( added . multihash ( ) ) . toString ( )
136
+ const mh = bs58 . encode ( added . node . multihash ( ) ) . toString ( )
134
137
expect ( mh ) . to . equal ( 'QmW2d9LPX4KxpeLDyH3tqYnHrkRMHx8xMQp9cpXEEj2DyR' )
135
- expect ( added . links ) . to . have . length ( 5 )
138
+ expect ( added . path ) . to . equal ( 'test-folder' )
139
+ expect ( added . node . links ) . to . have . length ( 5 )
136
140
done ( )
137
141
} )
138
142
} )
@@ -143,9 +147,10 @@ module.exports = (common) => {
143
147
return ipfs . files . add ( buf )
144
148
. then ( ( res ) => {
145
149
const added = res [ 0 ] != null ? res [ 0 ] : res
146
- const mh = bs58 . encode ( added . multihash ( ) ) . toString ( )
150
+ const mh = bs58 . encode ( added . node . multihash ( ) ) . toString ( )
147
151
expect ( mh ) . to . equal ( 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP' )
148
- expect ( added . links ) . to . have . length ( 0 )
152
+ expect ( added . path ) . to . equal ( mh )
153
+ expect ( added . node . links ) . to . have . length ( 0 )
149
154
} )
150
155
. catch ( ( err ) => {
151
156
expect ( err ) . to . not . exist
0 commit comments