mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 23:14:31 +00:00
fix: tolerate missing pi-coding-agent backend export
This commit is contained in:
26
src/agents/pi-model-discovery.compat.test.ts
Normal file
26
src/agents/pi-model-discovery.compat.test.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
describe("pi-model-discovery module compatibility", () => {
|
||||
afterEach(() => {
|
||||
vi.resetModules();
|
||||
vi.doUnmock("@mariozechner/pi-coding-agent");
|
||||
});
|
||||
|
||||
it("loads when InMemoryAuthStorageBackend is not exported", async () => {
|
||||
vi.resetModules();
|
||||
vi.doMock("@mariozechner/pi-coding-agent", () => {
|
||||
class MockAuthStorage {}
|
||||
class MockModelRegistry {}
|
||||
|
||||
return {
|
||||
AuthStorage: MockAuthStorage,
|
||||
ModelRegistry: MockModelRegistry,
|
||||
};
|
||||
});
|
||||
|
||||
await expect(import("./pi-model-discovery.js")).resolves.toMatchObject({
|
||||
discoverAuthStorage: expect.any(Function),
|
||||
discoverModels: expect.any(Function),
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user