This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 15 files changed +302
-31
lines changed
Expand file tree Collapse file tree 15 files changed +302
-31
lines changed Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
6+
57const IPFS = require ( '../../../src' )
68
79const DaemonFactory = require ( 'ipfsd-ctl' )
8- const df = DaemonFactory . create ( { remote : false } )
10+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
911
12+ const nodes = [ ]
1013const common = {
1114 setup : function ( callback ) {
12- callback ( null , df , 'proc' , IPFS )
15+ callback ( null , {
16+ spawnNode : ( cb ) => {
17+ df . spawn ( ( err , _ipfsd ) => {
18+ if ( err ) {
19+ return cb ( err )
20+ }
21+
22+ nodes . push ( _ipfsd )
23+ cb ( null , _ipfsd . api )
24+ } )
25+ }
26+ } )
27+ } ,
28+ teardown : function ( callback ) {
29+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1330 }
1431}
1532
Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
6+
57const IPFS = require ( '../../../src' )
68
79const DaemonFactory = require ( 'ipfsd-ctl' )
8- const df = DaemonFactory . create ( { remote : false } )
10+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
911
12+ const nodes = [ ]
1013const common = {
1114 setup : function ( callback ) {
12- callback ( null , df , 'proc' , IPFS )
15+ callback ( null , {
16+ spawnNode : ( cb ) => {
17+ df . spawn ( ( err , _ipfsd ) => {
18+ if ( err ) {
19+ return cb ( err )
20+ }
21+
22+ nodes . push ( _ipfsd )
23+ cb ( null , _ipfsd . api )
24+ } )
25+ }
26+ } )
27+ } ,
28+ teardown : function ( callback ) {
29+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1330 }
1431}
32+
1533test . config ( common )
Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
6+
57const IPFS = require ( '../../../src' )
68
79const DaemonFactory = require ( 'ipfsd-ctl' )
8- const df = DaemonFactory . create ( { remote : false } )
10+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
911
12+ const nodes = [ ]
1013const common = {
1114 setup : function ( callback ) {
12- callback ( null , df , 'proc' , IPFS )
15+ callback ( null , {
16+ spawnNode : ( cb ) => {
17+ df . spawn ( ( err , _ipfsd ) => {
18+ if ( err ) {
19+ return cb ( err )
20+ }
21+
22+ nodes . push ( _ipfsd )
23+ cb ( null , _ipfsd . api )
24+ } )
25+ }
26+ } )
27+ } ,
28+ teardown : function ( callback ) {
29+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1330 }
1431}
1532
Original file line number Diff line number Diff line change 33
44/*
55const test = require('interface-ipfs-core')
6+ const parallel = require('async/parallel')
67
78const DaemonFactory = require('ipfsd-ctl')
8- const df = DaemonFactory.create()
9+ const df = DaemonFactory.create({ type: 'proc', exec: IPFS } )
910
11+ const nodes = []
1012const common = {
1113 setup: function (callback) {
12- callback(null, df)
14+ callback(null, {
15+ spawnNode: (cb) => {
16+ df.spawn((err, _ipfsd) => {
17+ if (err) {
18+ return cb(err)
19+ }
20+
21+ nodes.push(_ipfsd)
22+ cb(null, _ipfsd.api)
23+ })
24+ }
25+ })
26+ },
27+ teardown: function (callback) {
28+ parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
1329 }
1430}
15-
1631test.dht(common)
1732*/
Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
6+
57const IPFS = require ( '../../../src' )
68
79const DaemonFactory = require ( 'ipfsd-ctl' )
8- const df = DaemonFactory . create ( { remote : false } )
10+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
911
12+ const nodes = [ ]
1013const common = {
1114 setup : function ( callback ) {
12- callback ( null , df , 'proc' , IPFS )
15+ callback ( null , {
16+ spawnNode : ( cb ) => {
17+ df . spawn ( ( err , _ipfsd ) => {
18+ if ( err ) {
19+ return cb ( err )
20+ }
21+
22+ nodes . push ( _ipfsd )
23+ cb ( null , _ipfsd . api )
24+ } )
25+ }
26+ } )
27+ } ,
28+ teardown : function ( callback ) {
29+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1330 }
1431}
1532
Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
6+
57const IPFS = require ( '../../../src' )
68
79const DaemonFactory = require ( 'ipfsd-ctl' )
8- const df = DaemonFactory . create ( { remote : false } )
10+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
911
12+ const nodes = [ ]
1013const common = {
1114 setup : function ( callback ) {
12- callback ( null , df , 'proc' , IPFS )
15+ callback ( null , {
16+ spawnNode : ( cb ) => {
17+ df . spawn ( ( err , _ipfsd ) => {
18+ if ( err ) {
19+ return cb ( err )
20+ }
21+
22+ nodes . push ( _ipfsd )
23+ cb ( null , _ipfsd . api )
24+ } )
25+ }
26+ } )
27+ } ,
28+ teardown : function ( callback ) {
29+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1330 }
1431}
32+
1533test . generic ( common )
Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
6+
57const IPFS = require ( '../../../src' )
68
79const DaemonFactory = require ( 'ipfsd-ctl' )
8- const df = DaemonFactory . create ( { remote : false } )
10+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
911
12+ const nodes = [ ]
1013const common = {
1114 setup : function ( callback ) {
12- callback ( null , df , 'proc' , IPFS )
15+ callback ( null , {
16+ spawnNode : ( cb ) => {
17+ df . spawn ( ( err , _ipfsd ) => {
18+ if ( err ) {
19+ return cb ( err )
20+ }
21+
22+ nodes . push ( _ipfsd )
23+ cb ( null , _ipfsd . api )
24+ } )
25+ }
26+ } )
27+ } ,
28+ teardown : function ( callback ) {
29+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1330 }
1431}
1532
Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
6+
57const IPFS = require ( '../../../src' )
68
79const DaemonFactory = require ( 'ipfsd-ctl' )
8- const df = DaemonFactory . create ( { remote : false } )
10+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
911
12+ const nodes = [ ]
1013const common = {
1114 setup : function ( callback ) {
12- callback ( null , df , 'proc' , IPFS )
15+ callback ( null , {
16+ spawnNode : ( cb ) => {
17+ df . spawn ( { args : [ '--enable-pubsub-experiment' ] } ,
18+ ( err , _ipfsd ) => {
19+ if ( err ) {
20+ return cb ( err )
21+ }
22+
23+ nodes . push ( _ipfsd )
24+ cb ( null , _ipfsd . api )
25+ } )
26+ }
27+ } )
28+ } ,
29+ teardown : function ( callback ) {
30+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1331 }
1432}
1533
Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
6+
57const IPFS = require ( '../../../src' )
68
79const DaemonFactory = require ( 'ipfsd-ctl' )
8- const df = DaemonFactory . create ( { remote : false } )
10+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
911
12+ const nodes = [ ]
1013const common = {
1114 setup : function ( callback ) {
12- callback ( null , df , 'proc' , IPFS )
15+ callback ( null , {
16+ spawnNode : ( repoPath , config , cb ) => {
17+ if ( typeof repoPath === 'function' ) {
18+ cb = repoPath
19+ repoPath = undefined
20+ }
21+
22+ if ( typeof config === 'function' ) {
23+ cb = config
24+ config = undefined
25+ }
26+
27+ df . spawn ( { repoPath, config } , ( err , _ipfsd ) => {
28+ if ( err ) {
29+ return cb ( err )
30+ }
31+
32+ nodes . push ( _ipfsd )
33+ cb ( null , _ipfsd . api )
34+ } )
35+ }
36+ } )
37+ } ,
38+ teardown : function ( callback ) {
39+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1340 }
1441}
1542
Original file line number Diff line number Diff line change 22'use strict'
33
44const test = require ( 'interface-ipfs-core' )
5+ const parallel = require ( 'async/parallel' )
56
67const DaemonFactory = require ( 'ipfsd-ctl' )
7- const df = DaemonFactory . create ( )
8+ const df = DaemonFactory . create ( { exec : 'src/cli/bin.js' } )
89
10+ const nodes = [ ]
911const common = {
1012 setup : function ( callback ) {
11- callback ( null , df )
13+ callback ( null , {
14+ spawnNode : ( cb ) => {
15+ df . spawn ( ( err , _ipfsd ) => {
16+ if ( err ) {
17+ return cb ( err )
18+ }
19+
20+ nodes . push ( _ipfsd )
21+ cb ( null , _ipfsd . api )
22+ } )
23+ }
24+ } )
25+ } ,
26+ teardown : function ( callback ) {
27+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
1228 }
1329}
1430
You can’t perform that action at this time.
0 commit comments