File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -547,6 +547,27 @@ test('download all', async t => {
547547 t . end ( )
548548} )
549549
550+ test ( 'can swarm with the replicate function' , async t => {
551+ const { clients, cleanup } = await createMany ( 2 )
552+
553+ const client1 = clients [ 0 ]
554+ const client2 = clients [ 1 ]
555+ const corestore1 = client1 . corestore ( )
556+ const corestore2 = client2 . corestore ( )
557+
558+ const core1 = corestore1 . get ( )
559+ await client1 . replicate ( core1 )
560+ await core1 . append ( Buffer . from ( 'hello world' , 'utf8' ) )
561+
562+ const core2 = corestore2 . get ( core1 . key )
563+ await client2 . replicate ( core2 )
564+ const block = await core2 . get ( 0 )
565+ t . same ( block . toString ( 'utf8' ) , 'hello world' )
566+
567+ await cleanup ( )
568+ t . end ( )
569+ } )
570+
550571function watchDownloadPromise ( core , expectedSeq ) {
551572 return new Promise ( ( resolve , reject ) => {
552573 core . once ( 'download' , seq => {
You can’t perform that action at this time.
0 commit comments