refactor!: rename chat providers to channels

This commit is contained in:
Peter Steinberger
2026-01-13 06:16:43 +00:00
parent 0cd632ba84
commit 90342a4f3a
393 changed files with 8004 additions and 6737 deletions

View File

@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { assertProvider, normalizeE164, toWhatsappJid } from "./index.js";
import { assertWebChannel, normalizeE164, toWhatsappJid } from "./index.js";
describe("normalizeE164", () => {
it("strips whatsapp prefix and whitespace", () => {
@@ -23,12 +23,12 @@ describe("toWhatsappJid", () => {
});
});
describe("assertProvider", () => {
it("accepts valid providers", () => {
expect(() => assertProvider("web")).not.toThrow();
describe("assertWebChannel", () => {
it("accepts valid channels", () => {
expect(() => assertWebChannel("web")).not.toThrow();
});
it("throws on invalid provider", () => {
expect(() => assertProvider("invalid" as string)).toThrow();
it("throws on invalid channel", () => {
expect(() => assertWebChannel("invalid" as string)).toThrow();
});
});