Skip to content

Commit

Permalink
direct batch/last for tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Ricart <[email protected]>
  • Loading branch information
aricart committed Nov 7, 2024
1 parent 1f92f34 commit 128bf43
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions jetstream/tests/jsm_direct_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ Deno.test("direct - last message for", async (t) => {
js.publish("a", "2"),
js.publish("a", "last a"),
js.publish("b", "1"),
]);
await delay(100);
await Promise.all([
js.publish("b", "last b"),
js.publish("z", "last z"),
]);
Expand Down Expand Up @@ -339,18 +342,16 @@ Deno.test("direct - last message for", async (t) => {
});
});

// FIXME: expected [1, 2, 3]
await t.step("up_to_time", async () => {
const up_to_time = await getDateFor(4);
const up_to_time = await getDateFor(5);
await assertBatch(
{ opts: { up_to_time, multi_last: ["a", "b", "z"] }, expect: [3, 5, 6] },
{ opts: { up_to_time, multi_last: ["a", "b", "z"] }, expect: [3, 4] },
);
});

// FIXME: expected - [1, 2]
await t.step("up_to_seq", async () => {
await assertBatch(
{ opts: { up_to_seq: 2, multi_last: ["a", "b", "z"] }, expect: [2] },
{ opts: { up_to_seq: 4, multi_last: ["a", "b", "z"] }, expect: [3, 4] },
);
});

Expand Down

0 comments on commit 128bf43

Please sign in to comment.