test: mock auth profile external overlay in oauth tests

This commit is contained in:
Peter Steinberger
2026-04-09 01:56:13 +01:00
parent 0c5e524224
commit 5f710bac35
3 changed files with 9 additions and 4 deletions

View File

@@ -11,8 +11,13 @@ vi.mock("../plugins/provider-runtime.runtime.js", () => ({
refreshProviderOAuthCredentialWithPlugin: async () => null,
}));
vi.mock("../plugins/provider-runtime.js", () => ({
resolveExternalAuthProfilesWithPlugins: () => [],
}));
afterAll(() => {
vi.doUnmock("../plugins/provider-runtime.runtime.js");
vi.doUnmock("../plugins/provider-runtime.js");
});
let clearRuntimeAuthProfileStoreSnapshots: typeof import("./auth-profiles.js").clearRuntimeAuthProfileStoreSnapshots;

View File

@@ -34,7 +34,7 @@ vi.mock("../../plugins/provider-runtime.runtime.js", () => ({
refreshProviderOAuthCredentialWithPlugin: async () => null,
}));
vi.mock("../plugins/provider-runtime.js", () => ({
vi.mock("../../plugins/provider-runtime.js", () => ({
resolveExternalAuthProfilesWithPlugins: () => [],
}));
@@ -42,7 +42,7 @@ afterAll(() => {
vi.doUnmock("@mariozechner/pi-ai/oauth");
vi.doUnmock("../cli-credentials.js");
vi.doUnmock("../../plugins/provider-runtime.runtime.js");
vi.doUnmock("../plugins/provider-runtime.js");
vi.doUnmock("../../plugins/provider-runtime.js");
});
let clearRuntimeAuthProfileStoreSnapshots: typeof import("./store.js").clearRuntimeAuthProfileStoreSnapshots;

View File

@@ -66,7 +66,7 @@ vi.mock("../../plugins/provider-runtime.runtime.js", () => ({
buildProviderAuthDoctorHintWithPlugin: buildProviderAuthDoctorHintWithPluginMock,
}));
vi.mock("../plugins/provider-runtime.js", () => ({
vi.mock("../../plugins/provider-runtime.js", () => ({
resolveExternalAuthProfilesWithPlugins: () => [],
}));
@@ -74,7 +74,7 @@ afterAll(() => {
vi.doUnmock("@mariozechner/pi-ai/oauth");
vi.doUnmock("../cli-credentials.js");
vi.doUnmock("../../plugins/provider-runtime.runtime.js");
vi.doUnmock("../plugins/provider-runtime.js");
vi.doUnmock("../../plugins/provider-runtime.js");
});
async function readPersistedStore(agentDir: string): Promise<AuthProfileStore> {