chore(tsgo/lint): fix CI errors

This commit is contained in:
Gustavo Madeira Santana
2026-03-02 03:03:11 -05:00
parent 22be0c5801
commit 1443bb9a84
17 changed files with 132 additions and 103 deletions

View File

@@ -1,4 +1,4 @@
import { vi } from "vitest";
import { vi, type Mock } from "vitest";
type SessionsSpawnTestConfig = ReturnType<(typeof import("../config/config.js"))["loadConfig"]>;
type CreateSessionsSpawnTool =
@@ -16,10 +16,6 @@ type SessionsSpawnGatewayMockOptions = {
agentWaitResult?: { status: "ok" | "timeout"; startedAt: number; endedAt: number };
};
// Avoid exporting vitest mock types (TS2742 under pnpm + d.ts emit).
// oxlint-disable-next-line typescript/no-explicit-any
type AnyMock = any;
const hoisted = vi.hoisted(() => {
const callGatewayMock = vi.fn();
const defaultConfigOverride = {
@@ -32,12 +28,12 @@ const hoisted = vi.hoisted(() => {
return { callGatewayMock, defaultConfigOverride, state };
});
export function getCallGatewayMock(): AnyMock {
export function getCallGatewayMock(): Mock {
return hoisted.callGatewayMock;
}
export function getGatewayRequests(): Array<GatewayRequest> {
return getCallGatewayMock().mock.calls.map((call: [unknown]) => call[0] as GatewayRequest);
return getCallGatewayMock().mock.calls.map((call: unknown[]) => call[0] as GatewayRequest);
}
export function getGatewayMethods(): Array<string | undefined> {