mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-13 10:11:20 +00:00
test: inject provider auth command fixtures
This commit is contained in:
@@ -78,10 +78,31 @@ function restoreConfiguredPrimaryModel(
|
||||
};
|
||||
}
|
||||
|
||||
type ProviderAuthChoiceRuntime = typeof import("./provider-auth-choice.runtime.js");
|
||||
|
||||
const defaultProviderAuthChoiceDeps = {
|
||||
loadPluginProviderRuntime: async (): Promise<ProviderAuthChoiceRuntime> =>
|
||||
import("./provider-auth-choice.runtime.js"),
|
||||
};
|
||||
|
||||
let providerAuthChoiceDeps = defaultProviderAuthChoiceDeps;
|
||||
|
||||
async function loadPluginProviderRuntime() {
|
||||
return import("./provider-auth-choice.runtime.js");
|
||||
return await providerAuthChoiceDeps.loadPluginProviderRuntime();
|
||||
}
|
||||
|
||||
export const __testing = {
|
||||
resetDepsForTest(): void {
|
||||
providerAuthChoiceDeps = defaultProviderAuthChoiceDeps;
|
||||
},
|
||||
setDepsForTest(deps: Partial<typeof defaultProviderAuthChoiceDeps>): void {
|
||||
providerAuthChoiceDeps = {
|
||||
...defaultProviderAuthChoiceDeps,
|
||||
...deps,
|
||||
};
|
||||
},
|
||||
} as const;
|
||||
|
||||
export async function runProviderPluginAuthMethod(params: {
|
||||
config: OpenClawConfig;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
|
||||
Reference in New Issue
Block a user