- Unified UX: channels login + message send; no plugin-specific top-level command\n- Added generic directory CLI for channel identity/groups\n- Docs: channel + plugin pages
19 lines
597 B
TypeScript
19 lines
597 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { zalouserPlugin } from "./channel.js";
|
|
|
|
describe("zalouser outbound chunker", () => {
|
|
it("chunks without empty strings and respects limit", () => {
|
|
const chunker = zalouserPlugin.outbound?.chunker;
|
|
expect(chunker).toBeTypeOf("function");
|
|
if (!chunker) return;
|
|
|
|
const limit = 10;
|
|
const chunks = chunker("hello world\nthis is a test", limit);
|
|
expect(chunks.length).toBeGreaterThan(1);
|
|
expect(chunks.every((c) => c.length > 0)).toBe(true);
|
|
expect(chunks.every((c) => c.length <= limit)).toBe(true);
|
|
});
|
|
});
|
|
|