release: WRNexusJS 0.4.0

This commit is contained in:
2026-07-27 12:42:18 +05:30
parent 8b728a3e5d
commit 30e5721e84
250 changed files with 10065 additions and 3923 deletions
+10 -1
View File
@@ -1,5 +1,5 @@
import { test, expect } from "bun:test";
import { createPubSub } from "../src/index.ts";
import { createPubSub, createResilientPubSub, PresenceChannel } from "../src/index.ts";
test("publish reaches exact + wildcard subscribers", async () => {
const bus = createPubSub();
@@ -35,3 +35,12 @@ test("unsubscribe stops delivery", async () => {
await bus.publish("t", 2);
expect(n).toBe(1);
});
test("resilient pubsub validates retry and presence settings", () => {
const driver = {
publish: async () => {},
subscribe: () => () => {},
};
expect(() => createResilientPubSub(driver, { retries: -1 })).toThrow("retries");
expect(() => new PresenceChannel(0)).toThrow("ttlMs");
});