mirror of
https://github.com/hanzomsg/nats.js.git
synced 2026-10-30 20:31:36 +00:00
- Replaced `jsr:@std/*` imports with `@std/*` as per deno linter changes. - Updated `@types/node` to `^24.3.1` and `typescript` to `^5.9.2`. - Synchronized dependency versions across modules for alignment. - Adjusted `deno.json` to reflect resolved import paths as per deno linter Signed-off-by: Alberto Ricart <[email protected]>
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { connect, createInbox, wsconnect } from "../src/mod.ts";
|
|
import { assertEquals, assertRejects } from "@std/assert";
|
|
|
|
Deno.test("basics", () => {
|
|
assertEquals(typeof connect, "function");
|
|
assertEquals(typeof wsconnect, "function");
|
|
assertEquals(typeof createInbox, "function");
|
|
});
|
|
|
|
Deno.test("basics - ws urls fail", async () => {
|
|
await assertRejects(
|
|
() => {
|
|
return connect({ servers: ["ws://localhost:4222"] });
|
|
},
|
|
Error,
|
|
"'servers' deno client doesn't support websockets, use the 'wsconnect' function instead",
|
|
);
|
|
|
|
await assertRejects(
|
|
() => {
|
|
return connect({ servers: "ws://localhost:4222" });
|
|
},
|
|
Error,
|
|
"'servers' deno client doesn't support websockets, use the 'wsconnect' function instead",
|
|
);
|
|
|
|
await assertRejects(
|
|
() => {
|
|
return connect({ servers: ["wss://localhost:4222"] });
|
|
},
|
|
Error,
|
|
"'servers' deno client doesn't support websockets, use the 'wsconnect' function instead",
|
|
);
|
|
|
|
await assertRejects(
|
|
() => {
|
|
return connect({ servers: "wss://localhost:4222" });
|
|
},
|
|
Error,
|
|
"'servers' deno client doesn't support websockets, use the 'wsconnect' function instead",
|
|
);
|
|
});
|