Skip to content

Commit

Permalink
added test verifying contributed header
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Apr 5, 2021
1 parent b82b35c commit abd5205
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/jetstream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
delay,
Empty,
ErrorCode,
headers,
JsMsg,
JsMsgCallback,
JSONCodec,
Expand Down Expand Up @@ -1299,6 +1300,25 @@ Deno.test("jetstream - cross account pull", async () => {
await cleanup(ns, admin, nc);
});

Deno.test("jetstream - publish headers", async () => {
const { ns, nc } = await setup(jetstreamServerConf({ debug: true }, true));
const { stream, subj } = await initStream(nc);
const jsm = await nc.jetstreamManager();
await jsm.consumers.add(stream, {
durable_name: "me",
ack_policy: AckPolicy.Explicit,
});
const js = nc.jetstream();
const h = headers();
h.set("a", "b");

await js.publish(subj, Empty, { headers: h });
const ms = await js.pull(stream, "me");
ms.ack();
assertEquals(ms.headers!.get("a"), "b");
await cleanup(ns, nc);
});

// Deno.test("jetstream - cross account fetch", async () => {
// const { ns, nc: admin } = await setup(
// jetstreamExportServerConf(),
Expand Down

0 comments on commit abd5205

Please sign in to comment.