test(cli): fix option-collision mock typings

This commit is contained in:
Gustavo Madeira Santana
2026-02-17 21:31:49 -05:00
parent c90b09cb02
commit 40a6661597
6 changed files with 51 additions and 23 deletions

View File

@@ -1,8 +1,10 @@
import { Command } from "commander";
import { beforeEach, describe, expect, it, vi } from "vitest";
const callGatewayCli = vi.fn(async () => ({ ok: true }));
const gatewayStatusCommand = vi.fn(async () => {});
const callGatewayCli = vi.fn(async (_method: string, _opts: unknown, _params?: unknown) => ({
ok: true,
}));
const gatewayStatusCommand = vi.fn(async (_opts: unknown, _runtime: unknown) => {});
const runtimeLogs: string[] = [];
const runtimeErrors: string[] = [];

View File

@@ -1,17 +1,17 @@
import { Command } from "commander";
import { beforeEach, describe, expect, it, vi } from "vitest";
const startGatewayServer = vi.fn(async () => ({
const startGatewayServer = vi.fn(async (_port: number, _opts?: unknown) => ({
close: vi.fn(async () => {}),
}));
const setGatewayWsLogStyle = vi.fn();
const setVerbose = vi.fn();
const forceFreePortAndWait = vi.fn(async () => ({
const setGatewayWsLogStyle = vi.fn((_style: string) => undefined);
const setVerbose = vi.fn((_enabled: boolean) => undefined);
const forceFreePortAndWait = vi.fn(async (_port: number, _opts: unknown) => ({
killed: [],
waitedMs: 0,
escalatedToSigkill: false,
}));
const ensureDevGatewayConfig = vi.fn(async () => {});
const ensureDevGatewayConfig = vi.fn(async (_opts?: unknown) => {});
const runGatewayLoop = vi.fn(async ({ start }: { start: () => Promise<unknown> }) => {
await start();
});