mirror of https://github.com/openclaw/openclaw.git
test(types): annotate model auth mock return openclaw#20057 thanks @mbelinky
This commit is contained in:
parent
a85e2c9eb7
commit
26523f8a38
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue