mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test: speed up plugin state runtime test
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { resolveStateDir } from "../config/paths.js";
|
||||
import type { PluginRecord } from "../plugins/registry-types.js";
|
||||
import { createPluginRegistry } from "../plugins/registry.js";
|
||||
import { createPluginRuntime } from "../plugins/runtime/index.js";
|
||||
import type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||
import { withOpenClawTestState } from "../test-utils/openclaw-test-state.js";
|
||||
import { resetPluginStateStoreForTests } from "./plugin-state-store.js";
|
||||
|
||||
@@ -44,7 +45,14 @@ function createPluginRecord(id: string, origin: PluginRecord["origin"] = "bundle
|
||||
function createTestPluginRegistry() {
|
||||
return createPluginRegistry({
|
||||
logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() },
|
||||
runtime: createPluginRuntime(),
|
||||
runtime: {
|
||||
state: {
|
||||
resolveStateDir,
|
||||
openKeyedStore: () => {
|
||||
throw new Error("registry plugin runtime proxy should bind openKeyedStore");
|
||||
},
|
||||
},
|
||||
} as PluginRuntime,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user