Files
oh-my-pi/packages/coding-agent/test/status-text-sanitization.test.ts
T
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00

19 lines
535 B
TypeScript

import { describe, expect, it } from "bun:test";
import { sanitizeStatusText } from "@oh-my-pi/pi-coding-agent/modes/shared";
describe("sanitizeStatusText", () => {
it("strips OSC, DCS, PM, APC, and 8-bit CSI escape sequences", () => {
const input =
"prefix " +
"\x1b]8;;https://example.com\x07link\x1b]8;;\x07" +
" " +
"\x1bPhidden-dcs\x1b\\" +
"\x1b^hidden-pm\x1b\\" +
"\x1b_hidden-apc\x1b\\" +
"\x9b31mred\x9b0m" +
" suffix";
expect(sanitizeStatusText(input)).toBe("prefix link red suffix");
});
});