mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
test(plugins): type persisted bridge fixtures
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { InstalledPluginIndex } from "../plugins/installed-plugin-index.js";
|
||||
import type { InstalledPluginStartupInfo } from "../plugins/installed-plugin-index.js";
|
||||
import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";
|
||||
|
||||
const readPersistedInstalledPluginIndexMock = vi.fn();
|
||||
const loadPluginManifestRegistryForInstalledIndexMock = vi.fn();
|
||||
|
||||
const startupInfo: InstalledPluginStartupInfo = {
|
||||
sidecar: false,
|
||||
memory: false,
|
||||
deferConfiguredChannelFullLoadUntilAfterListen: false,
|
||||
agentHarnesses: [],
|
||||
};
|
||||
|
||||
vi.mock("../plugins/installed-plugin-index-store.js", () => ({
|
||||
readPersistedInstalledPluginIndex: (...args: unknown[]) =>
|
||||
readPersistedInstalledPluginIndexMock(...args),
|
||||
@@ -25,9 +33,10 @@ function makeIndex(record: InstalledPluginIndex["plugins"][number]): InstalledPl
|
||||
migrationVersion: 1,
|
||||
policyHash: "test",
|
||||
generatedAtMs: 1,
|
||||
refreshReason: "test",
|
||||
refreshReason: "manual",
|
||||
installRecords: {},
|
||||
plugins: [record],
|
||||
diagnostics: [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -78,7 +87,7 @@ describe("listPersistedBundledPluginLocationBridges", () => {
|
||||
rootDir: "/app/dist/extensions/diagnostics-otel",
|
||||
origin: "bundled",
|
||||
enabled: true,
|
||||
startup: {},
|
||||
startup: startupInfo,
|
||||
compat: [],
|
||||
packageInstall: {
|
||||
defaultChoice: "clawhub",
|
||||
@@ -123,7 +132,7 @@ describe("listPersistedBundledPluginLocationBridges", () => {
|
||||
rootDir: "/app/dist/extensions/diagnostics-otel",
|
||||
origin: "bundled",
|
||||
enabled: true,
|
||||
startup: {},
|
||||
startup: startupInfo,
|
||||
compat: [],
|
||||
packageInstall: {
|
||||
defaultChoice: "clawhub",
|
||||
|
||||
Reference in New Issue
Block a user