mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-22 01:02:41 +00:00
* feat(terminals): expose workspace ownership through the SDK and CLI Directory-based terminal creation selected the oldest workspace sharing that path. Expose explicit workspace ownership in the shared public API and CLI, retain ownership and process directories in listings, and acknowledge terminal deletion after teardown. * fix(file-observer): preserve nested shallow reconciliation scopes A parent directory scan does not visit its descendants. Collapsing change scopes discarded nested scans and left coalesced native deletions unseen until a full audit. * test(terminals): extract output waits from end-to-end scenarios
20 lines
770 B
TypeScript
20 lines
770 B
TypeScript
import assert from "node:assert/strict";
|
|
import type { createE2ETestContext } from "./test-daemon.ts";
|
|
|
|
export async function waitForTerminalOutput(
|
|
paseo: Awaited<ReturnType<typeof createE2ETestContext>>["paseo"],
|
|
terminalId: string,
|
|
text: string,
|
|
): Promise<void> {
|
|
const deadline = Date.now() + 10_000;
|
|
let lines: string[] = [];
|
|
while (Date.now() < deadline) {
|
|
const result = await paseo(["terminal", "capture", terminalId, "--json"]);
|
|
assert.equal(result.exitCode, 0, result.stderr);
|
|
lines = JSON.parse(result.stdout).lines;
|
|
if (lines.some((line) => line.includes(text))) return;
|
|
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
}
|
|
throw new Error(`Missing terminal output: ${text}\nLast capture:\n${lines.join("\n")}`);
|
|
}
|