release: WRNexusJS 0.8.0
Quality / quality (ubuntu-latest) (push) Failing after 21s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-02 23:18:51 +05:30
parent 87507edf59
commit 586a6db8ff
625 changed files with 243608 additions and 11210 deletions
+15
View File
@@ -36,6 +36,21 @@ test("unsubscribe stops delivery", async () => {
expect(n).toBe(1);
});
test("publish awaits async handlers and close rejects new work", async () => {
const bus = createPubSub();
let completed = false;
bus.subscribe("task", async () => {
await Promise.resolve();
completed = true;
});
await bus.publish("task", {});
expect(completed).toBe(true);
await bus.close();
await bus.close();
await expect(bus.publish("task", {})).rejects.toThrow("WRN-PUBSUB-CLOSED");
expect(() => bus.subscribe("task", () => {})).toThrow("WRN-PUBSUB-CLOSED");
});
test("resilient pubsub validates retry and presence settings", () => {
const driver = {
publish: async () => {},