test: hardened dynamic-border and plugin-install tests for full-suite runs

This commit is contained in:
can1357
2026-07-14 23:19:45 +02:00
parent 053272e4e1
commit 62d0377780
2 changed files with 56 additions and 19 deletions
@@ -23,6 +23,14 @@ import * as piUtils from "@oh-my-pi/pi-utils";
import { removeWithRetries } from "@oh-my-pi/pi-utils";
import type { Subprocess } from "bun";
function textStream(text: string): ReadableStream<Uint8Array> {
const body = new Response(text).body;
if (!body) {
throw new Error("Failed to create response stream");
}
return body;
}
function emptyStream(): ReadableStream<Uint8Array> {
const body = new Response("").body;
if (!body) {
@@ -313,6 +321,16 @@ describe("PluginManager.install with git sources", () => {
} as Subprocess;
}
if (cmd[1] === "pm") {
expect(cmd).toEqual(["bun", "pm", "cache"]);
return {
pid: 3,
stdout: textStream(path.join(tmpRoot, "no-such-bun-cache")),
stderr: emptyStream(),
exited: Promise.resolve(0),
} as Subprocess;
}
expect(cmd).toEqual(["bun", "update", "replaced-plugin"]);
return {
pid: 2,