test: harden vitest no-isolate coverage

This commit is contained in:
Peter Steinberger
2026-03-22 10:47:52 -07:00
parent 719bfb46ff
commit 1ceaad18a6
39 changed files with 827 additions and 295 deletions

View File

@@ -1,9 +1,15 @@
import { describe, expect, it, vi } from "vitest";
vi.mock("@mariozechner/pi-ai/oauth", () => ({
getOAuthApiKey: vi.fn(),
getOAuthProviders: vi.fn(() => []),
}));
vi.mock("@mariozechner/pi-ai/oauth", async () => {
const actual = await vi.importActual<typeof import("@mariozechner/pi-ai/oauth")>(
"@mariozechner/pi-ai/oauth",
);
return {
...actual,
getOAuthApiKey: vi.fn(),
getOAuthProviders: vi.fn(() => []),
};
});
vi.mock("openclaw/plugin-sdk/provider-models", () => ({
normalizeModelCompat: (model: Record<string, unknown>) => model,