Skip to content

Commit

Permalink
add test for node helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Aug 16, 2023
1 parent 8fb53ef commit 9f791d2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,21 @@ test('can make a tree batch', async function (t) {

t.alike(hash, batchHash)
})

test('batched tree batch contains new nodes', async function (t) {
const core = await create()

const b = core.batch()

await b.append('a')

const batchTreeBatch = b.createTreeBatch()
const batchNode = await batchTreeBatch.get(0)

await b.flush()

const treeBatch = core.createTreeBatch()
const node = await treeBatch.get(0)

t.alike(node, batchNode)
})

0 comments on commit 9f791d2

Please sign in to comment.