test: restore fs bridge helper export

This commit is contained in:
Peter Steinberger
2026-03-11 02:37:52 +00:00
parent a0d5462571
commit a52104c235
2 changed files with 14 additions and 11 deletions

View File

@@ -48,6 +48,10 @@ export function findCallByScriptFragment(fragment: string) {
return mockedExecDockerRaw.mock.calls.find(([args]) => getDockerScript(args).includes(fragment)); return mockedExecDockerRaw.mock.calls.find(([args]) => getDockerScript(args).includes(fragment));
} }
export function findCallByDockerArg(position: number, value: string) {
return mockedExecDockerRaw.mock.calls.find(([args]) => getDockerArg(args, position) === value);
}
export function findCallsByScriptFragment(fragment: string) { export function findCallsByScriptFragment(fragment: string) {
return mockedExecDockerRaw.mock.calls.filter(([args]) => return mockedExecDockerRaw.mock.calls.filter(([args]) =>
getDockerScript(args).includes(fragment), getDockerScript(args).includes(fragment),

View File

@@ -36,17 +36,16 @@ const renderGatewayPortHealthDiagnostics = vi.fn(() => ["diag: unhealthy port"])
const renderRestartDiagnostics = vi.fn(() => ["diag: unhealthy runtime"]); const renderRestartDiagnostics = vi.fn(() => ["diag: unhealthy runtime"]);
const resolveGatewayPort = vi.fn(() => 18789); const resolveGatewayPort = vi.fn(() => 18789);
const findGatewayPidsOnPortSync = vi.fn<(port: number) => number[]>(() => []); const findGatewayPidsOnPortSync = vi.fn<(port: number) => number[]>(() => []);
const probeGateway = const probeGateway = vi.fn<
vi.fn< (opts: {
(opts: { url: string;
url: string; auth?: { token?: string; password?: string };
auth?: { token?: string; password?: string }; timeoutMs: number;
timeoutMs: number; }) => Promise<{
}) => Promise<{ ok: boolean;
ok: boolean; configSnapshot: unknown;
configSnapshot: unknown; }>
}> >();
>();
const isRestartEnabled = vi.fn<(config?: { commands?: unknown }) => boolean>(() => true); const isRestartEnabled = vi.fn<(config?: { commands?: unknown }) => boolean>(() => true);
const loadConfig = vi.fn(() => ({})); const loadConfig = vi.fn(() => ({}));