@@ -81,7 +81,6 @@ describe('name', function () {
8181
8282 // TODO: unskip when DHT is enabled: https://github.com/ipfs/js-ipfs/pull/1994
8383 describe . skip ( 'work with dht' , ( ) => {
84- let nodes
8584 let nodeA
8685 let nodeB
8786 let nodeC
@@ -115,7 +114,6 @@ describe('name', function () {
115114 ] , ( err , _nodes ) => {
116115 expect ( err ) . to . not . exist ( )
117116
118- nodes = _nodes
119117 nodeA = _nodes [ 0 ] . api
120118 nodeB = _nodes [ 1 ] . api
121119 nodeC = _nodes [ 2 ] . api
@@ -136,11 +134,7 @@ describe('name', function () {
136134 } )
137135 } )
138136
139- after ( function ( done ) {
140- this . timeout ( 80 * 1000 )
141-
142- parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , done )
143- } )
137+ after ( ( ) => df . clean ( ) )
144138
145139 it ( 'should publish and then resolve correctly with the default options' , function ( done ) {
146140 this . timeout ( 380 * 1000 )
@@ -175,32 +169,17 @@ describe('name', function () {
175169 before ( async function ( ) {
176170 this . timeout ( 40 * 1000 )
177171 ipfsd = await df . spawn ( {
178- exec : IPFS ,
179- args : [ '--pass' , hat ( ) ] ,
180- config : {
181- Bootstrap : [ ] ,
182- Discovery : {
183- MDNS : {
184- Enabled : false
185- } ,
186- webRTCStar : {
187- Enabled : false
188- }
189- }
190- } ,
191- preload : { enabled : false }
172+ ipfsOptions : {
173+ pass : hat ( )
174+ }
192175 } )
193176 node = ipfsd . api
194177
195178 const res = await node . id ( )
196179 nodeId = res . id
197180 } )
198181
199- after ( ( ) => {
200- if ( ipfsd ) {
201- return ipfsd . stop ( )
202- }
203- } )
182+ after ( ( ) => df . clean ( ) )
204183
205184 it ( 'should error to publish if does not receive private key' , function ( ) {
206185 return expect ( node . _ipns . publisher . publish ( null , ipfsRef ) )
@@ -322,32 +301,18 @@ describe('name', function () {
322301 before ( async function ( ) {
323302 this . timeout ( 40 * 1000 )
324303 ipfsd = await df . spawn ( {
325- exec : IPFS ,
326- args : [ '--pass' , hat ( ) , '--offline' ] ,
327- config : {
328- Bootstrap : [ ] ,
329- Discovery : {
330- MDNS : {
331- Enabled : false
332- } ,
333- webRTCStar : {
334- Enabled : false
335- }
336- }
337- } ,
338- preload : { enabled : false }
304+ ipfsOptions : {
305+ pass : hat ( ) ,
306+ offline : true
307+ }
339308 } )
340309 node = ipfsd . api
341310
342311 const res = await node . id ( )
343312 nodeId = res . id
344313 } )
345314
346- after ( ( ) => {
347- if ( ipfsd ) {
348- return ipfsd . stop ( )
349- }
350- } )
315+ after ( ( ) => df . clean ( ) )
351316
352317 it ( 'should resolve an ipfs path correctly' , async function ( ) {
353318 const res = await node . add ( fixture )
0 commit comments