Skip to content

Commit

Permalink
[upgrade] nbc to version 1.0.6 (#431)
Browse files Browse the repository at this point in the history
[test] added test to exercise header deserialization for a JetStream a stored message
  • Loading branch information
aricart authored Jun 2, 2021
1 parent e50979b commit 4989272
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
32 changes: 19 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nats",
"version": "2.0.4",
"version": "2.0.6",
"description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system",
"keywords": [
"nats",
Expand Down Expand Up @@ -41,7 +41,7 @@
"build": "tsc",
"cjs": "deno run --allow-all bin/cjs-fix-imports.ts -o nats-base-client/ ./.deps/nats.deno/nats-base-client/",
"clean": "shx rm -Rf ./lib/* ./nats-base-client ./.deps",
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.0.4 https://github.com/nats-io/nats.deno.git",
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.0.6 https://github.com/nats-io/nats.deno.git",
"fmt": "deno fmt ./src/ ./examples/ ./test/",
"prepack": "npm run clone-nbc && npm run cjs && npm run build",
"ava": "nyc ava --verbose -T 60000",
Expand Down
2 changes: 1 addition & 1 deletion src/node_transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { connect as tlsConnect, TlsOptions, TLSSocket } from "tls";
const { resolve } = require("path");
const { readFile, existsSync } = require("fs");

const VERSION = "2.0.4";
const VERSION = "2.0.6";
const LANG = "nats.js";

export class NodeTransport implements Transport {
Expand Down
10 changes: 7 additions & 3 deletions test/jetstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/
const test = require("ava");
const { connect, Empty } = require(
const { connect, Empty, headers } = require(
"../",
);
const { AckPolicy } = require("../lib/nats-base-client/types");
Expand Down Expand Up @@ -45,8 +45,10 @@ test("jetstream - jsm", async (t) => {
t.is(streams.length, 1);
t.is(streams[0].config.name, "stream");

nc.publish("hello.world");
nc.publish("hello.world");
const h = headers();
h.set("xxx", "a");
nc.publish("hello.world", Empty, { headers: h });
nc.publish("hello.world", Empty, { headers: h });

si = await jsm.streams.info("stream");
t.is(si.state.messages, 2);
Expand Down Expand Up @@ -84,6 +86,8 @@ test("jetstream - jsm", async (t) => {

const sm = await jsm.streams.getMessage("stream", 2);
t.is(sm.seq, 2);
t.truthy(sm.header);
t.is(sm.header.get("xxx"), "a");

ok = await jsm.streams.deleteMessage("stream", 1);
t.is(ok, true);
Expand Down

0 comments on commit 4989272

Please sign in to comment.