From 3e0076c9ced442b35739d1059e7e9971a7608643 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 16 Feb 2026 00:35:36 +0000 Subject: [PATCH] perf(test): drop redundant index entrypoint tests --- src/index.test.ts | 32 -------------------------------- src/utils.test.ts | 4 ++++ 2 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 src/index.test.ts diff --git a/src/index.test.ts b/src/index.test.ts deleted file mode 100644 index efaf3f0023..0000000000 --- a/src/index.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { assertWebChannel, normalizeE164, toWhatsappJid } from "./index.js"; - -describe("normalizeE164", () => { - it("strips whatsapp prefix and whitespace", () => { - expect(normalizeE164("whatsapp:+1 555 555 0123")).toBe("+15555550123"); - }); - - it("adds plus when missing", () => { - expect(normalizeE164("1555123")).toBe("+1555123"); - }); -}); - -describe("toWhatsappJid", () => { - it("converts E164 to jid", () => { - expect(toWhatsappJid("+1 555 555 0123")).toBe("15555550123@s.whatsapp.net"); - }); - - it("keeps group JIDs intact", () => { - expect(toWhatsappJid("123456789-987654321@g.us")).toBe("123456789-987654321@g.us"); - }); -}); - -describe("assertWebChannel", () => { - it("accepts valid channels", () => { - expect(() => assertWebChannel("web")).not.toThrow(); - }); - - it("throws on invalid channel", () => { - expect(() => assertWebChannel("invalid" as string)).toThrow(); - }); -}); diff --git a/src/utils.test.ts b/src/utils.test.ts index 163470090f..6c4bf3aceb 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -60,6 +60,10 @@ describe("sleep", () => { }); describe("assertWebChannel", () => { + it("accepts valid channel", () => { + expect(() => assertWebChannel("web")).not.toThrow(); + }); + it("throws for invalid channel", () => { expect(() => assertWebChannel("bad" as string)).toThrow(); });