4
4
const { getDescribe, getIt, expect } = require ( '../utils/mocha' )
5
5
const { waitForWantlistKey } = require ( './utils' )
6
6
7
- /** @typedef { import("ipfsd-ctl").TestsInterface } TestsInterface */
7
+ /** @typedef { import("ipfsd-ctl/src/factory") } Factory */
8
8
/**
9
- * @param {TestsInterface } common
9
+ * @param {Factory } common
10
10
* @param {Object } options
11
11
*/
12
12
module . exports = ( common , options ) => {
@@ -19,22 +19,14 @@ module.exports = (common, options) => {
19
19
let ipfsB
20
20
const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR'
21
21
22
- before ( async function ( ) {
23
- // CI takes longer to instantiate the daemon, so we need to increase the
24
- // timeout for the before step
25
- this . timeout ( 60 * 1000 )
26
-
27
- ipfsA = await common . setup ( )
28
- ipfsB = await common . setup ( { type : 'go' } )
22
+ before ( async ( ) => {
23
+ ipfsA = ( await common . spawn ( ) ) . api
24
+ ipfsB = ( await common . spawn ( { type : 'go' } ) ) . api
29
25
// Add key to the wantlist for ipfsB
30
26
ipfsB . block . get ( key ) . catch ( ( ) => { } )
31
27
} )
32
28
33
- after ( function ( ) {
34
- this . timeout ( 30 * 1000 )
35
-
36
- return common . teardown ( )
37
- } )
29
+ after ( ( ) => common . clean ( ) )
38
30
39
31
it ( 'should get the wantlist' , function ( ) {
40
32
return waitForWantlistKey ( ipfsB , key )
@@ -48,7 +40,7 @@ module.exports = (common, options) => {
48
40
} )
49
41
50
42
it ( 'should not get the wantlist when offline' , async ( ) => {
51
- const node = await common . node ( )
43
+ const node = await common . spawn ( )
52
44
await node . stop ( )
53
45
54
46
return expect ( node . api . bitswap . stat ( ) ) . to . eventually . be . rejected ( )
0 commit comments