22'use strict'
33
44const 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' )
86const isWindows = process . platform && process . platform === 'win32'
97
108/** @typedef {import("ipfsd-ctl").ControllerOptions } ControllerOptions */
119
1210describe ( '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 ( )
2612
2713 tests . root ( commonFactory , {
2814 skip : [
@@ -320,13 +306,13 @@ describe('interface-ipfs-core tests', () => {
320306
321307 tests . miscellaneous ( commonFactory )
322308
323- tests . name ( createFactory ( merge ( commonOptions ,
309+ tests . name ( factory (
324310 {
325311 ipfsOptions : {
326312 offline : true
327313 }
328314 }
329- ) ) , {
315+ ) , {
330316 skip : [
331317 {
332318 name : 'should resolve a record from peerid as cidv1 in base32' ,
@@ -335,15 +321,15 @@ describe('interface-ipfs-core tests', () => {
335321 ]
336322 } )
337323
338- tests . namePubsub ( createFactory ( merge ( commonOptions ,
324+ tests . namePubsub ( factory (
339325 {
340326 ipfsOptions : {
341327 EXPERIMENTAL : {
342328 ipnsPubsub : true
343329 }
344330 }
345331 }
346- ) ) , {
332+ ) , {
347333 skip : [
348334 // name.pubsub.cancel
349335 {
@@ -371,7 +357,7 @@ describe('interface-ipfs-core tests', () => {
371357 ]
372358 } )
373359
374- tests . pubsub ( createFactory ( commonOptions , {
360+ tests . pubsub ( factory ( { } , {
375361 go : {
376362 args : [ '--enable-pubsub-experiment' ]
377363 }
0 commit comments