This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 10 files changed +58
-37
lines changed
10 files changed +58
-37
lines changed Original file line number Diff line number Diff line change 3
3
'use strict'
4
4
5
5
const test = require ( 'interface-ipfs-core' )
6
+ const parallel = require ( 'async/parallel' )
7
+
6
8
const IPFSApi = require ( '../../src' )
7
9
8
10
const DaemonFactory = require ( 'ipfsd-ctl' )
9
11
const df = DaemonFactory . create ( )
10
12
11
- let ipfsd = null
13
+ const nodes = [ ]
12
14
const common = {
13
15
setup : function ( callback ) {
14
16
callback ( null , {
@@ -18,14 +20,14 @@ const common = {
18
20
return cb ( err )
19
21
}
20
22
21
- ipfsd = _ipfsd
23
+ nodes . push ( _ipfsd )
22
24
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
23
25
} )
24
26
}
25
27
} )
26
28
} ,
27
29
teardown : function ( callback ) {
28
- ipfsd . stop ( callback )
30
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
29
31
}
30
32
}
31
33
Original file line number Diff line number Diff line change 3
3
'use strict'
4
4
5
5
const test = require ( 'interface-ipfs-core' )
6
+ const parallel = require ( 'async/parallel' )
7
+
6
8
const IPFSApi = require ( '../../src' )
7
9
8
10
const DaemonFactory = require ( 'ipfsd-ctl' )
9
11
const df = DaemonFactory . create ( )
10
12
11
- let ipfsd = null
13
+ const nodes = [ ]
12
14
const common = {
13
15
setup : function ( callback ) {
14
16
callback ( null , {
@@ -18,14 +20,14 @@ const common = {
18
20
return cb ( err )
19
21
}
20
22
21
- ipfsd = _ipfsd
23
+ nodes . push ( _ipfsd )
22
24
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
23
25
} )
24
26
}
25
27
} )
26
28
} ,
27
29
teardown : function ( callback ) {
28
- ipfsd . stop ( callback )
30
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
29
31
}
30
32
}
31
33
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFSApi = require ( '../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
10
const df = DaemonFactory . create ( )
9
11
10
- let ipfsd = null
12
+ const nodes = [ ]
11
13
const common = {
12
14
setup : function ( callback ) {
13
15
callback ( null , {
@@ -17,14 +19,14 @@ const common = {
17
19
return cb ( err )
18
20
}
19
21
20
- ipfsd = _ipfsd
22
+ nodes . push ( _ipfsd )
21
23
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
22
24
} )
23
25
}
24
26
} )
25
27
} ,
26
28
teardown : function ( callback ) {
27
- ipfsd . stop ( callback )
29
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
28
30
}
29
31
}
30
32
Original file line number Diff line number Diff line change 3
3
'use strict'
4
4
5
5
const test = require ( 'interface-ipfs-core' )
6
+ const parallel = require ( 'async/parallel' )
7
+
6
8
const IPFSApi = require ( '../../src' )
7
9
8
10
const DaemonFactory = require ( 'ipfsd-ctl' )
9
11
const df = DaemonFactory . create ( )
10
12
11
- let ipfsd = null
13
+ const nodes = [ ]
12
14
const common = {
13
15
setup : function ( callback ) {
14
16
callback ( null , {
@@ -18,14 +20,14 @@ const common = {
18
20
return cb ( err )
19
21
}
20
22
21
- ipfsd = _ipfsd
23
+ nodes . push ( _ipfsd )
22
24
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
23
25
} )
24
26
}
25
27
} )
26
28
} ,
27
29
teardown : function ( callback ) {
28
- ipfsd . stop ( callback )
30
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
29
31
}
30
32
}
31
33
Original file line number Diff line number Diff line change 3
3
'use strict'
4
4
5
5
const test = require ( 'interface-ipfs-core' )
6
+ const parallel = require ( 'async/parallel' )
7
+
6
8
const IPFSApi = require ( '../../src' )
7
9
8
10
const DaemonFactory = require ( 'ipfsd-ctl' )
9
11
const df = DaemonFactory . create ( )
10
12
11
- let ipfsd = null
13
+ const nodes = [ ]
12
14
const common = {
13
15
setup : function ( callback ) {
14
16
callback ( null , {
@@ -18,14 +20,14 @@ const common = {
18
20
return cb ( err )
19
21
}
20
22
21
- ipfsd = _ipfsd
23
+ nodes . push ( _ipfsd )
22
24
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
23
25
} )
24
26
}
25
27
} )
26
28
} ,
27
29
teardown : function ( callback ) {
28
- ipfsd . stop ( callback )
30
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
29
31
}
30
32
}
31
33
Original file line number Diff line number Diff line change 3
3
'use strict'
4
4
5
5
const test = require ( 'interface-ipfs-core' )
6
+ const parallel = require ( 'async/parallel' )
7
+
6
8
const IPFSApi = require ( '../../src' )
7
9
8
10
const DaemonFactory = require ( 'ipfsd-ctl' )
9
11
const df = DaemonFactory . create ( )
10
12
11
- let ipfsd = null
13
+ const nodes = [ ]
12
14
const common = {
13
15
setup : function ( callback ) {
14
16
callback ( null , {
@@ -18,14 +20,14 @@ const common = {
18
20
return cb ( err )
19
21
}
20
22
21
- ipfsd = _ipfsd
23
+ nodes . push ( _ipfsd )
22
24
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
23
25
} )
24
26
}
25
27
} )
26
28
} ,
27
29
teardown : function ( callback ) {
28
- ipfsd . stop ( callback )
30
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
29
31
}
30
32
}
31
33
Original file line number Diff line number Diff line change 3
3
'use strict'
4
4
5
5
const test = require ( 'interface-ipfs-core' )
6
+ const parallel = require ( 'async/parallel' )
7
+
6
8
const IPFSApi = require ( '../../src' )
7
9
8
10
const DaemonFactory = require ( 'ipfsd-ctl' )
9
11
const df = DaemonFactory . create ( )
10
12
11
- let ipfsd = null
13
+ const nodes = [ ]
12
14
const common = {
13
15
setup : function ( callback ) {
14
16
callback ( null , {
@@ -18,14 +20,14 @@ const common = {
18
20
return cb ( err )
19
21
}
20
22
21
- ipfsd = _ipfsd
23
+ nodes . push ( _ipfsd )
22
24
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
23
25
} )
24
26
}
25
27
} )
26
28
} ,
27
29
teardown : function ( callback ) {
28
- ipfsd . stop ( callback )
30
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
29
31
}
30
32
}
31
33
Original file line number Diff line number Diff line change 3
3
'use strict'
4
4
5
5
const test = require ( 'interface-ipfs-core' )
6
+ const parallel = require ( 'async/parallel' )
7
+
6
8
const IPFSApi = require ( '../../src' )
7
9
8
10
const DaemonFactory = require ( 'ipfsd-ctl' )
9
11
const df = DaemonFactory . create ( )
10
12
11
- let ipfsd = null
13
+ const nodes = [ ]
12
14
const common = {
13
15
setup : function ( callback ) {
14
16
callback ( null , {
@@ -18,14 +20,14 @@ const common = {
18
20
return cb ( err )
19
21
}
20
22
21
- ipfsd = _ipfsd
23
+ nodes . push ( _ipfsd )
22
24
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
23
25
} )
24
26
}
25
27
} )
26
28
} ,
27
29
teardown : function ( callback ) {
28
- ipfsd . stop ( callback )
30
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
29
31
}
30
32
}
31
33
Original file line number Diff line number Diff line change 5
5
const test = require ( 'interface-ipfs-core' )
6
6
const isNode = require ( 'detect-node' )
7
7
8
+ const parallel = require ( 'async/parallel' )
9
+
8
10
const IPFSApi = require ( '../../src' )
9
11
10
12
const DaemonFactory = require ( 'ipfsd-ctl' )
11
13
const df = DaemonFactory . create ( )
12
14
13
15
if ( isNode ) {
14
- let ipfsd = null
16
+ const nodes = [ ]
15
17
const common = {
16
18
setup : function ( callback ) {
17
19
callback ( null , {
18
20
spawnNode : ( cb ) => {
19
- df . spawn ( { args : [ '--enable-pubsub-experiment' ] } , ( err , _ipfsd ) => {
20
- if ( err ) {
21
- return cb ( err )
22
- }
23
-
24
- ipfsd = _ipfsd
25
- cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
26
- } )
21
+ df . spawn ( { args : [ '--enable-pubsub-experiment' ] } ,
22
+ ( err , _ipfsd ) => {
23
+ if ( err ) {
24
+ return cb ( err )
25
+ }
26
+
27
+ nodes . push ( _ipfsd )
28
+ cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
29
+ } )
27
30
}
28
31
} )
29
32
} ,
30
33
teardown : function ( callback ) {
31
- ipfsd . stop ( callback )
34
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
32
35
}
33
36
}
34
37
Original file line number Diff line number Diff line change 3
3
'use strict'
4
4
5
5
const test = require ( 'interface-ipfs-core' )
6
+ const parallel = require ( 'async/parallel' )
7
+
6
8
const IPFSApi = require ( '../../src' )
7
9
8
10
const DaemonFactory = require ( 'ipfsd-ctl' )
9
11
const df = DaemonFactory . create ( )
10
12
11
- let ipfsd = null
13
+ const nodes = [ ]
12
14
const common = {
13
15
setup : function ( callback ) {
14
16
callback ( null , {
@@ -28,14 +30,14 @@ const common = {
28
30
return cb ( err )
29
31
}
30
32
31
- ipfsd = _ipfsd
33
+ nodes . push ( _ipfsd )
32
34
cb ( null , IPFSApi ( _ipfsd . apiAddr ) )
33
35
} )
34
36
}
35
37
} )
36
38
} ,
37
39
teardown : function ( callback ) {
38
- ipfsd . stop ( callback )
40
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
39
41
}
40
42
}
41
43
You can’t perform that action at this time.
0 commit comments