@@ -59,7 +59,7 @@ describe('bitswap with mocks', function () {
5959 describe ( 'receive message' , ( ) => {
6060 it ( 'simple block message' , async ( ) => {
6161 const bs = new Bitswap ( mockLibp2pNode ( ) , blockstore )
62- bs . start ( )
62+ await bs . start ( )
6363
6464 const other = ids [ 1 ]
6565
@@ -93,12 +93,12 @@ describe('bitswap with mocks', function () {
9393 expect ( ledger . recv ) . to . equal ( 96 )
9494 expect ( ledger . exchanged ) . to . equal ( 2 )
9595
96- bs . stop ( )
96+ await bs . stop ( )
9797 } )
9898
9999 it ( 'simple want message' , async ( ) => {
100100 const bs = new Bitswap ( mockLibp2pNode ( ) , blockstore )
101- bs . start ( )
101+ await bs . start ( )
102102
103103 const other = ids [ 1 ]
104104 const b1 = blocks [ 0 ]
@@ -116,14 +116,14 @@ describe('bitswap with mocks', function () {
116116 expect ( wl . has ( b1 . cid . toString ( base58btc ) ) ) . to . eql ( true )
117117 expect ( wl . has ( b2 . cid . toString ( base58btc ) ) ) . to . eql ( true )
118118
119- bs . stop ( )
119+ await bs . stop ( )
120120 } )
121121
122122 it ( 'multi peer' , async function ( ) {
123123 this . timeout ( 80 * 1000 )
124124 const bs = new Bitswap ( mockLibp2pNode ( ) , blockstore )
125125
126- bs . start ( )
126+ await bs . start ( )
127127
128128 const others = await makePeerIds ( 5 )
129129 const blocks = await makeBlocks ( 10 )
@@ -147,12 +147,12 @@ describe('bitswap with mocks', function () {
147147 await storeHasBlocks ( msg , blockstore )
148148 }
149149
150- bs . stop ( )
150+ await bs . stop ( )
151151 } )
152152
153153 it ( 'ignore unwanted blocks' , async ( ) => {
154154 const bs = new Bitswap ( mockLibp2pNode ( ) , blockstore )
155- bs . start ( )
155+ await bs . start ( )
156156
157157 const other = ids [ 1 ]
158158
@@ -192,7 +192,7 @@ describe('bitswap with mocks', function () {
192192 expect ( ledger . recv ) . to . equal ( 144 )
193193 expect ( ledger . exchanged ) . to . equal ( 3 )
194194
195- bs . stop ( )
195+ await bs . stop ( )
196196 } )
197197 } )
198198
@@ -256,7 +256,7 @@ describe('bitswap with mocks', function () {
256256 bs . network = net
257257 bs . wm . network = net
258258 bs . engine . network = net
259- bs . start ( )
259+ await bs . start ( )
260260 const get = bs . get ( block . cid )
261261
262262 setTimeout ( ( ) => {
@@ -269,7 +269,7 @@ describe('bitswap with mocks', function () {
269269 finish ( 2 )
270270
271271 finish . assert ( )
272- bs . stop ( )
272+ await bs . stop ( )
273273 } )
274274
275275 it ( 'block is sent after local add' , async ( ) => {
@@ -348,12 +348,12 @@ describe('bitswap with mocks', function () {
348348 // Create and start bs1
349349 const bs1 = new Bitswap ( mockLibp2pNode ( ) , blockstore )
350350 applyNetwork ( bs1 , n1 )
351- bs1 . start ( )
351+ await bs1 . start ( )
352352
353353 // Create and start bs2
354354 const bs2 = new Bitswap ( mockLibp2pNode ( ) , new MemoryBlockstore ( ) )
355355 applyNetwork ( bs2 , n2 )
356- bs2 . start ( )
356+ await bs2 . start ( )
357357
358358 bs1 . _onPeerConnected ( other )
359359 bs2 . _onPeerConnected ( me )
@@ -365,8 +365,8 @@ describe('bitswap with mocks', function () {
365365 const b1 = await p1
366366 expect ( b1 ) . to . equalBytes ( block . data )
367367
368- bs1 . stop ( )
369- bs2 . stop ( )
368+ await bs1 . stop ( )
369+ await bs2 . stop ( )
370370 } )
371371
372372 it ( 'double get' , async ( ) => {
@@ -472,7 +472,7 @@ describe('bitswap with mocks', function () {
472472 describe ( 'unwant' , ( ) => {
473473 it ( 'removes blocks that are wanted multiple times' , async ( ) => {
474474 const bs = new Bitswap ( mockLibp2pNode ( ) , blockstore )
475- bs . start ( )
475+ await bs . start ( )
476476
477477 const b = blocks [ 12 ]
478478 const p = Promise . all ( [
@@ -484,7 +484,7 @@ describe('bitswap with mocks', function () {
484484
485485 await expect ( p ) . to . eventually . be . rejected ( )
486486
487- bs . stop ( )
487+ await bs . stop ( )
488488 } )
489489 } )
490490
0 commit comments