@@ -81,7 +81,6 @@ describe('name', function () {
81
81
82
82
// TODO: unskip when DHT is enabled: https://github.com/ipfs/js-ipfs/pull/1994
83
83
describe . skip ( 'work with dht' , ( ) => {
84
- let nodes
85
84
let nodeA
86
85
let nodeB
87
86
let nodeC
@@ -115,7 +114,6 @@ describe('name', function () {
115
114
] , ( err , _nodes ) => {
116
115
expect ( err ) . to . not . exist ( )
117
116
118
- nodes = _nodes
119
117
nodeA = _nodes [ 0 ] . api
120
118
nodeB = _nodes [ 1 ] . api
121
119
nodeC = _nodes [ 2 ] . api
@@ -136,11 +134,7 @@ describe('name', function () {
136
134
} )
137
135
} )
138
136
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 ( ) )
144
138
145
139
it ( 'should publish and then resolve correctly with the default options' , function ( done ) {
146
140
this . timeout ( 380 * 1000 )
@@ -175,32 +169,17 @@ describe('name', function () {
175
169
before ( async function ( ) {
176
170
this . timeout ( 40 * 1000 )
177
171
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
+ }
192
175
} )
193
176
node = ipfsd . api
194
177
195
178
const res = await node . id ( )
196
179
nodeId = res . id
197
180
} )
198
181
199
- after ( ( ) => {
200
- if ( ipfsd ) {
201
- return ipfsd . stop ( )
202
- }
203
- } )
182
+ after ( ( ) => df . clean ( ) )
204
183
205
184
it ( 'should error to publish if does not receive private key' , function ( ) {
206
185
return expect ( node . _ipns . publisher . publish ( null , ipfsRef ) )
@@ -322,32 +301,18 @@ describe('name', function () {
322
301
before ( async function ( ) {
323
302
this . timeout ( 40 * 1000 )
324
303
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
+ }
339
308
} )
340
309
node = ipfsd . api
341
310
342
311
const res = await node . id ( )
343
312
nodeId = res . id
344
313
} )
345
314
346
- after ( ( ) => {
347
- if ( ipfsd ) {
348
- return ipfsd . stop ( )
349
- }
350
- } )
315
+ after ( ( ) => df . clean ( ) )
351
316
352
317
it ( 'should resolve an ipfs path correctly' , async function ( ) {
353
318
const res = await node . add ( fixture )
0 commit comments