mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
test(types): annotate model auth mock return openclaw#20057 thanks @mbelinky
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import { vi } from "vitest";
|
||||
|
||||
export function createModelAuthMockModule() {
|
||||
type ModelAuthMockModule = {
|
||||
resolveApiKeyForProvider: (...args: unknown[]) => unknown;
|
||||
requireApiKey: (auth: { apiKey?: string; mode?: string }, provider: string) => string;
|
||||
};
|
||||
|
||||
export function createModelAuthMockModule(): ModelAuthMockModule {
|
||||
return {
|
||||
resolveApiKeyForProvider: vi.fn(),
|
||||
resolveApiKeyForProvider: vi.fn() as (...args: unknown[]) => unknown,
|
||||
requireApiKey: (auth: { apiKey?: string; mode?: string }, provider: string) => {
|
||||
if (auth?.apiKey) {
|
||||
return auth.apiKey;
|
||||
|
||||
Reference in New Issue
Block a user