This repository was archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
/
Copy pathinterface.spec.js
383 lines (361 loc) · 11.1 KB
/
interface.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
/* eslint-env mocha */
'use strict'
const tests = require('interface-ipfs-core')
const factory = require('./utils/factory')
const isWindows = process.platform && process.platform === 'win32'
/** @typedef {import("ipfsd-ctl").ControllerOptions} ControllerOptions */
describe('interface-ipfs-core tests', () => {
const commonFactory = factory()
tests.root(commonFactory, {
skip: [
{
name: 'should add with mode as string',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should add with mode as number',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should add with mtime as Date',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should add with mtime as { nsecs, secs }',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should add with mtime as timespec',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should add with mtime as hrtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should export a chunk of a file',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should ls with metadata',
reason: 'TODO not implemented in go-ipfs yet'
}
]
})
tests.bitswap(commonFactory)
tests.block(commonFactory, {
skip: [{
name: 'should get a block added as CIDv1 with a CIDv0',
reason: 'go-ipfs does not support the `version` param'
}]
})
tests.bootstrap(commonFactory, {
skip: [{
name: 'should return a list containing the bootstrap peer when called with a valid arg (ip4)',
reason: 'TODO unskip when go-ipfs switches to p2p for libp2p keys'
}, {
name: 'should prevent duplicate inserts of bootstrap peers',
reason: 'TODO unskip when go-ipfs switches to p2p for libp2p keys'
}, {
name: 'should return a list containing the peer removed when called with a valid arg (ip4)',
reason: 'TODO unskip when go-ipfs switches to p2p for libp2p keys'
}]
})
tests.config(commonFactory, {
skip: [
// config.replace
{
name: 'replace',
reason: 'FIXME Waiting for fix on go-ipfs https://github.com/ipfs/js-ipfs-http-client/pull/307#discussion_r69281789 and https://github.com/ipfs/go-ipfs/issues/2927'
},
{
name: 'should list config profiles',
reason: 'TODO: Not implemented in go-ipfs'
},
{
name: 'should strip private key from diff output',
reason: 'TODO: Not implemented in go-ipfs'
}
]
})
tests.dag(commonFactory, {
skip: [
// dag.tree
{
name: 'tree',
reason: 'TODO vmx 2018-02-22: Currently the tree API is not exposed in go-ipfs'
},
// dag.get:
{
name: 'should get a dag-pb node local value',
reason: 'FIXME vmx 2018-02-22: Currently not supported in go-ipfs, it might be possible once https://github.com/ipfs/go-ipfs/issues/4728 is done'
},
{
name: 'should get dag-pb value via dag-cbor node',
reason: 'FIXME vmx 2018-02-22: Currently not supported in go-ipfs, it might be possible once https://github.com/ipfs/go-ipfs/issues/4728 is done'
},
{
name: 'should get by CID string + path',
reason: 'FIXME vmx 2018-02-22: Currently not supported in go-ipfs, it might be possible once https://github.com/ipfs/go-ipfs/issues/4728 is done'
},
{
name: 'should get only a CID, due to resolving locally only',
reason: 'FIXME: go-ipfs does not support localResolve option'
}
]
})
tests.dht(commonFactory)
tests.files(commonFactory, {
skip: [
{
name: 'should ls directory',
reason: 'TODO unskip when go-ipfs supports --long https://github.com/ipfs/go-ipfs/pull/6528'
},
{
name: 'should list a file directly',
reason: 'TODO unskip when go-ipfs supports --long https://github.com/ipfs/go-ipfs/pull/6528'
},
{
name: 'should ls directory and include metadata',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should read from outside of mfs',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should ls from outside of mfs',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should change file mode',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should change directory mode',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should change file mode as string',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should change file mode to 0',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should update file mtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should update directory mtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and specify mode',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and specify mtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should write file and specify mode',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should write file and specify mtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should respect metadata when copying files',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should respect metadata when copying directories',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should respect metadata when copying from outside of mfs',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should have default mtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should set mtime as Date',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should set mtime as { nsecs, secs }',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should set mtime as timespec',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should set mtime as hrtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and have default mode',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and specify mode as string',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and specify mode as number',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and specify mtime as Date',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and specify mtime as { nsecs, secs }',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and specify mtime as timespec',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should make directory and specify mtime as hrtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should write file and specify mode as a string',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should write file and specify mode as a number',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should write file and specify mtime as Date',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should write file and specify mtime as { nsecs, secs }',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should write file and specify mtime as timespec',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should write file and specify mtime as hrtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should stat file with mode',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should stat file with mtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should stat dir with mode',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should stat dir with mtime',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should stat sharded dir with mode',
reason: 'TODO not implemented in go-ipfs yet'
},
{
name: 'should stat sharded dir with mtime',
reason: 'TODO not implemented in go-ipfs yet'
}
]
})
tests.key(commonFactory, {
skip: [
// key.export
{
name: 'export',
reason: 'TODO not implemented in go-ipfs yet'
},
// key.import
{
name: 'import',
reason: 'TODO not implemented in go-ipfs yet'
}
]
})
tests.miscellaneous(commonFactory)
tests.name(factory(
{
ipfsOptions: {
offline: true
}
}
), {
skip: [
{
name: 'should resolve a record from peerid as cidv1 in base32',
reason: 'TODO not implemented in go-ipfs yet: https://github.com/ipfs/go-ipfs/issues/5287'
}
]
})
tests.namePubsub(factory(
{
ipfsOptions: {
EXPERIMENTAL: {
ipnsPubsub: true
}
}
}
), {
skip: [
// name.pubsub.cancel
{
name: 'should cancel a subscription correctly returning true',
reason: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
},
// name.pubsub.subs
{
name: 'should get the list of subscriptions updated after a resolve',
reason: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
}
]
})
tests.object(commonFactory)
tests.pin(commonFactory)
tests.ping(commonFactory, {
skip: [
{
name: 'should fail when pinging a peer that is not available',
reason: 'FIXME go-ipfs return success with text: Looking up peer <cid>'
}
]
})
tests.pubsub(factory({}, {
go: {
args: ['--enable-pubsub-experiment']
}
}), {
skip: isWindows ? [
// pubsub.subscribe
{
name: 'should send/receive 100 messages',
reason: 'FIXME https://github.com/ipfs/interface-ipfs-core/pull/188#issuecomment-354673246 and https://github.com/ipfs/go-ipfs/issues/4778'
},
{
name: 'should receive multiple messages',
reason: 'FIXME https://github.com/ipfs/interface-ipfs-core/pull/188#issuecomment-354673246 and https://github.com/ipfs/go-ipfs/issues/4778'
}
] : null
})
tests.repo(commonFactory)
tests.stats(commonFactory)
tests.swarm(commonFactory)
})