mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 22:01:24 +00:00
test: annotate harness mocks to avoid TS2742 in CI
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { afterEach, beforeEach, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { MockFn } from "../test-utils/vitest-mock-fn.js";
|
||||
import { withTempHome as withTempHomeBase } from "../../test/helpers/temp-home.js";
|
||||
|
||||
export async function withModelsTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||
@@ -57,7 +58,7 @@ export async function withUnsetCopilotTokenEnv<T>(fn: () => Promise<T>): Promise
|
||||
});
|
||||
}
|
||||
|
||||
export function mockCopilotTokenExchangeSuccess() {
|
||||
export function mockCopilotTokenExchangeSuccess(): MockFn {
|
||||
const fetchMock = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
status: 200,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { vi } from "vitest";
|
||||
import type { MockFn } from "../test-utils/vitest-mock-fn.js";
|
||||
|
||||
export type LoadedConfig = ReturnType<(typeof import("../config/config.js"))["loadConfig"]>;
|
||||
|
||||
export const callGatewayMock = vi.fn();
|
||||
export const callGatewayMock: MockFn = vi.fn();
|
||||
|
||||
const defaultConfig: LoadedConfig = {
|
||||
session: {
|
||||
|
||||
Reference in New Issue
Block a user