Skip to content
Source
Sign inSign up

subagentProjection.test.ts

13 lines534 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { subagentThreadTitle } from "./subagentProjection.ts";
4​
5describe("subagentThreadTitle", () => {
6 it("clips a long prompt without splitting a surrogate pair", () => {
7 const title = (prompt: string) =>
8 subagentThreadTitle({ parentTitle: "Parent", prompt, ordinal: 1 });
9​
10 expect(title(`${"a".repeat(68)}😀 and more work.`)).toBe(`${"a".repeat(68)}...`);
11 expect(title(`${"a".repeat(67)}😀 and more work.`)).toBe(`${"a".repeat(67)}😀...`);
12 });
13});