Skip to content

Commit

Permalink
Finish test
Browse files Browse the repository at this point in the history
  • Loading branch information
HDegroote committed Jan 14, 2025
1 parent bc1235e commit a8ac867
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/atomic.js
Original file line number Diff line number Diff line change
@@ -13,11 +13,15 @@ test('basic atomized flow with a single core', async (t) => {
const atomCore = core.atomize(atom)

await writeBlocks(atomCore, 1, { start: 2 })
{
const expected = [...initBlocks, b4a.from('block2'), null]
t.alike(await readBlocks(core, 4), [...initBlocks, null, null], 'not added to original core')
t.alike(await readBlocks(atomCore, 4), expected, 'added to atomized core')
}
const expected = [...initBlocks, b4a.from('block2'), null]

t.alike(await readBlocks(core, 4), [...initBlocks, null, null], 'not added to original core')
t.alike(await readBlocks(atomCore, 4), expected, 'added to atomized core')

await atom.flush()

t.alike(await readBlocks(core, 4), expected, 'flushing adds to the original core')
t.alike(await readBlocks(atomCore, 4), expected, 'added to atomized core')
})

test('write to original core while there is an atomized one', async (t) => {
@@ -28,7 +32,6 @@ test('write to original core while there is an atomized one', async (t) => {
const atom = core.createAtom()
const atomCore = core.atomize(atom)

console.log('wrting more')
await writeBlocks(core, 1, { start: 2 })

{

0 comments on commit a8ac867

Please sign in to comment.