@@ -32,14 +32,14 @@ function waitForPeers (ipfs, topic, peersToWait, callback) {
32
32
} , 500 )
33
33
}
34
34
35
- function spawnWithId ( factory , callback ) {
35
+ function spawnWithId ( df , callback ) {
36
36
waterfall ( [
37
- ( cb ) => factory . spawnNode ( cb ) ,
38
- ( node , cb ) => node . id ( ( err , res ) => {
37
+ ( cb ) => df . spawn ( { args : [ '--enable-pubsub-experiment' ] } , cb ) ,
38
+ ( node , cb ) => node . api . id ( ( err , res ) => {
39
39
if ( err ) {
40
40
return cb ( err )
41
41
}
42
- node . peerId = res
42
+ node . api . peerId = res
43
43
cb ( null , node )
44
44
} )
45
45
] , callback )
@@ -68,36 +68,37 @@ module.exports = (common) => {
68
68
let ipfs2
69
69
let ipfs3
70
70
71
+ let ipfsdNodes
71
72
before ( function ( done ) {
72
73
// CI takes longer to instantiate the daemon, so we need to increase the
73
74
// timeout for the before step
74
75
this . timeout ( 100 * 1000 )
75
76
76
- common . setup ( ( err , factory ) => {
77
+ common . setup ( ( err , df ) => {
77
78
if ( err ) {
78
79
return done ( err )
79
80
}
80
81
81
82
series ( [
82
- ( cb ) => spawnWithId ( factory , cb ) ,
83
- ( cb ) => spawnWithId ( factory , cb ) ,
84
- ( cb ) => spawnWithId ( factory , cb )
83
+ ( cb ) => spawnWithId ( df , cb ) ,
84
+ ( cb ) => spawnWithId ( df , cb ) ,
85
+ ( cb ) => spawnWithId ( df , cb )
85
86
] , ( err , nodes ) => {
86
87
if ( err ) {
87
88
return done ( err )
88
89
}
89
90
90
- ipfs1 = nodes [ 0 ]
91
- ipfs2 = nodes [ 1 ]
92
- ipfs3 = nodes [ 2 ]
91
+ ipfsdNodes = nodes
92
+
93
+ ipfs1 = nodes [ 0 ] . api
94
+ ipfs2 = nodes [ 1 ] . api
95
+ ipfs3 = nodes [ 2 ] . api
93
96
done ( )
94
97
} )
95
98
} )
96
99
} )
97
100
98
- after ( ( done ) => {
99
- common . teardown ( done )
100
- } )
101
+ after ( ( done ) => parallel ( ipfsdNodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , done ) )
101
102
102
103
describe ( 'single node' , ( ) => {
103
104
describe ( '.publish' , ( ) => {
0 commit comments