Files
vue-tui/packages/runtime-tests/integration/pty/ci.test.ts
T
Yunfei He 8befc0d0de fix: rewrite PTY tests to use node-pty directly, upgrade to 1.2.0-beta.13
node-pty 1.1.0's POSIX_SPAWN_CLOEXEC_DEFAULT flag fails on macOS 26 (Tahoe).
Beta.13 fixes this. Rewrote helpers to match Ink's node-pty architecture,
removed python pty-spawn and force-tty workarounds, added check-pty guard
that skips all 82 tests when node-pty is unavailable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 01:08:25 +08:00

34 lines
1.2 KiB
TypeScript

import { test as it, expect } from "vite-plus/test";
import { run } from "./helpers/run.ts";
import stripAnsi from "strip-ansi";
it("render only last frame in CI", async () => {
const output = await run("ci", { env: { CI: "true" }, columns: 0 });
const clean = stripAnsi(output).replaceAll("\r", "");
for (let i = 0; i <= 4; i++) {
expect(clean).not.toContain(`Counter: ${i}`);
}
expect(clean).toContain("Counter: 5");
});
it("render all frames if CI=false", async () => {
const output = await run("ci", { env: { CI: "false" }, columns: 0 });
const clean = stripAnsi(output).replaceAll("\r", "");
expect(clean).toContain("Counter:");
expect(clean).toContain("Counter: 5");
expect(clean).toContain("#1");
});
it("debug mode in CI", async () => {
const output = await run("ci-debug", { env: { CI: "true" }, columns: 0 });
const clean = stripAnsi(output).replaceAll("\r", "");
expect(clean).toContain("Hello");
});
it("debug after exit", async () => {
const output = await run("ci-debug-after-exit", { env: { CI: "true" }, columns: 0 });
const clean = stripAnsi(output).replaceAll("\r", "");
expect(clean).toContain("Hello");
expect(clean).toContain("DONE");
});