2
2
'use strict'
3
3
4
4
const tests = require ( 'interface-ipfs-core' )
5
- const merge = require ( 'merge-options' )
6
- const { createFactory } = require ( 'ipfsd-ctl' )
7
- const { findBin } = require ( 'ipfsd-ctl/src/utils' )
5
+ const factory = require ( './utils/factory' )
8
6
const isWindows = process . platform && process . platform === 'win32'
9
7
10
8
/** @typedef {import("ipfsd-ctl").ControllerOptions } ControllerOptions */
11
9
12
10
describe ( 'interface-ipfs-core tests' , ( ) => {
13
- /** @type ControllerOptions */
14
- const commonOptions = {
15
- test : true ,
16
- ipfsHttpModule : {
17
- path : require . resolve ( '../src' ) ,
18
- ref : require ( '../src' )
19
- } ,
20
- ipfsOptions : {
21
- pass : 'ipfs-is-awesome-software'
22
- } ,
23
- ipfsBin : findBin ( 'go' )
24
- }
25
- const commonFactory = createFactory ( commonOptions )
11
+ const commonFactory = factory ( )
26
12
27
13
tests . root ( commonFactory , {
28
14
skip : [
@@ -320,13 +306,13 @@ describe('interface-ipfs-core tests', () => {
320
306
321
307
tests . miscellaneous ( commonFactory )
322
308
323
- tests . name ( createFactory ( merge ( commonOptions ,
309
+ tests . name ( factory (
324
310
{
325
311
ipfsOptions : {
326
312
offline : true
327
313
}
328
314
}
329
- ) ) , {
315
+ ) , {
330
316
skip : [
331
317
{
332
318
name : 'should resolve a record from peerid as cidv1 in base32' ,
@@ -335,15 +321,15 @@ describe('interface-ipfs-core tests', () => {
335
321
]
336
322
} )
337
323
338
- tests . namePubsub ( createFactory ( merge ( commonOptions ,
324
+ tests . namePubsub ( factory (
339
325
{
340
326
ipfsOptions : {
341
327
EXPERIMENTAL : {
342
328
ipnsPubsub : true
343
329
}
344
330
}
345
331
}
346
- ) ) , {
332
+ ) , {
347
333
skip : [
348
334
// name.pubsub.cancel
349
335
{
@@ -371,7 +357,7 @@ describe('interface-ipfs-core tests', () => {
371
357
]
372
358
} )
373
359
374
- tests . pubsub ( createFactory ( commonOptions , {
360
+ tests . pubsub ( factory ( { } , {
375
361
go : {
376
362
args : [ '--enable-pubsub-experiment' ]
377
363
}
0 commit comments