Skip to content

Commit

Permalink
[TEST] changed source transforms test to not be order sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Oct 17, 2023
1 parent 00cbba6 commit 9963493
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions jetstream/tests/jetstream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4437,7 +4437,7 @@ Deno.test("jetstream - input transform", async () => {

Deno.test("jetstream - source transforms", async () => {
const { ns, nc } = await setup(jetstreamServerConf());
if (await notCompatible(ns, nc, "2.10.2")) {
if (await notCompatible(ns, nc, "2.10.0")) {
return;
}
const jsm = await nc.jetstreamManager();
Expand Down Expand Up @@ -4476,8 +4476,16 @@ Deno.test("jetstream - source transforms", async () => {
await delay(100);
}

const m = await jsm.streams.getMessage("sourced", { seq: 1 });
assertEquals(m.subject, "foo2.foo");
const map = new Map<string, string>();
const oc = await js.consumers.get("sourced");
const iter = await oc.fetch({ max_messages: 3 });
for await (const m of iter) {
map.set(m.subject, m.subject);
}

assert(map.has("foo2.foo"));
assert(map.has("bar"));
assert(map.has("baz"));

await cleanup(ns, nc);
});
Expand Down

0 comments on commit 9963493

Please sign in to comment.