Skip to content

Commit af5bfbf

Browse files
committed
fix tests
1 parent 5cf5201 commit af5bfbf

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/client/buffer.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,27 @@ test("buffer flush in mutation context", async () => {
2323

2424
// Test that reading with buffered operations in a mutation works (auto-flushes)
2525
await t.run(async (ctx) => {
26-
aggregate.buffer(true);
26+
aggregate.startBuffering();
2727
await aggregate.insert(ctx, { key: 1, id: "a" });
2828
await aggregate.insert(ctx, { key: 2, id: "b" });
2929

3030
// This should work because we're in a mutation context and it auto-flushes
3131
const count = await aggregate.count(ctx);
3232
expect(count).toBe(2);
3333

34-
aggregate.buffer(false);
34+
await aggregate.finishBuffering(ctx);
3535
});
3636

3737
// Test manual flush
3838
await t.run(async (ctx) => {
39-
aggregate.buffer(true);
39+
aggregate.startBuffering();
4040
await aggregate.insert(ctx, { key: 3, id: "c" });
4141

4242
// Manual flush
4343
await aggregate.flush(ctx);
4444

45-
aggregate.buffer(false);
46-
4745
const count = await aggregate.count(ctx);
4846
expect(count).toBe(3);
47+
await aggregate.finishBuffering(ctx);
4948
});
5049
});

0 commit comments

Comments
 (0)