From 75fb3a1ada4b4535b42e40dedf2cade04829cf22 Mon Sep 17 00:00:00 2001 From: Lucas Barrena Date: Mon, 24 Jul 2023 19:07:44 -0300 Subject: [PATCH] Pass custom stream --- test/replicate.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/replicate.js b/test/replicate.js index 9d48e2e4..d581c76c 100644 --- a/test/replicate.js +++ b/test/replicate.js @@ -1172,7 +1172,7 @@ test('try cancel block from a different session', async function (t) { }) test.solo('closing last session should stop replication', async function (t) { - t.plan(5) + t.plan(7) const a = await create() await a.append(['a', 'b', 'c']) @@ -1180,7 +1180,10 @@ test.solo('closing last session should stop replication', async function (t) { const b = await create(a.key) const sessionA = a.session() - const [s1, s2] = replicate(sessionA, b, t) + + const [n1, n2] = makeStreamPair(t, { latency: [0, 0] }) + const s1 = sessionA.replicate(n1) + const s2 = b.replicate(n2) t.alike(await b.get(0), b4a.from('a')) t.alike(await b.get(1), b4a.from('b')) @@ -1189,6 +1192,9 @@ test.solo('closing last session should stop replication', async function (t) { // await a.close() // await new Promise(resolve => setTimeout(resolve, 500)) + t.is(n2.destroying, false) + t.is(n2.destroying, false) + t.is(s1.destroying, false) t.is(s2.destroying, false)