refactor: remove stale plugin test cache hooks

This commit is contained in:
Peter Steinberger
2026-05-01 22:16:46 +01:00
parent eb2701e595
commit 019f4a5bb8
4 changed files with 0 additions and 25 deletions

View File

@@ -10,13 +10,11 @@ vi.mock("./plugin-registry.js", () => ({
import {
buildManifestBuiltInModelSuppressionResolver,
clearManifestModelSuppressionCacheForTest,
resolveManifestBuiltInModelSuppression,
} from "./manifest-model-suppression.js";
describe("manifest model suppression", () => {
beforeEach(() => {
clearManifestModelSuppressionCacheForTest();
mocks.loadPluginManifestRegistryForPluginRegistry.mockReset();
mocks.loadPluginManifestRegistryForPluginRegistry.mockReturnValue({
diagnostics: [],

View File

@@ -99,10 +99,6 @@ function manifestSuppressionMatchesConditions(params: {
return true;
}
export function clearManifestModelSuppressionCacheForTest(): void {
// Manifest suppressions are read fresh. Keep the test hook as a no-op.
}
export function buildManifestBuiltInModelSuppressionResolver(params: {
config?: OpenClawConfig;
workspaceDir?: string;

View File

@@ -22,7 +22,6 @@ const tempDirs: string[] = [];
const mocks = getRegistryJitiMocks();
let clearPluginSetupRegistryCache: typeof import("./setup-registry.js").clearPluginSetupRegistryCache;
let setupRegistryTesting: typeof import("./setup-registry.js").__testing;
let resolvePluginSetupRegistry: typeof import("./setup-registry.js").resolvePluginSetupRegistry;
let resolvePluginSetupProvider: typeof import("./setup-registry.js").resolvePluginSetupProvider;
let resolvePluginSetupCliBackend: typeof import("./setup-registry.js").resolvePluginSetupCliBackend;
@@ -177,7 +176,6 @@ describe("setup-registry getJiti", () => {
resetRegistryJitiMocks();
vi.resetModules();
({
__testing: setupRegistryTesting,
clearPluginSetupRegistryCache,
resolvePluginSetupRegistry,
resolvePluginSetupProvider,
@@ -806,7 +804,6 @@ describe("setup-registry getJiti", () => {
expect(resolvePluginSetupProvider({ provider: "openai", env: {} })?.id).toBe("openai");
expect(resolvePluginSetupProvider({ provider: "anthropic", env: {} })?.id).toBe("anthropic");
expect(setupRegistryTesting.getCacheSizes().setupProvider).toBe(0);
expect(resolvePluginSetupProvider({ provider: "openai", env: {} })?.id).toBe("openai");
expect(resolvePluginSetupCliBackend({ backend: "codex-cli", env: {} })?.backend.id).toBe(
@@ -815,7 +812,6 @@ describe("setup-registry getJiti", () => {
expect(resolvePluginSetupCliBackend({ backend: "claude-cli", env: {} })?.backend.id).toBe(
"claude-cli",
);
expect(setupRegistryTesting.getCacheSizes().setupCliBackend).toBe(0);
expect(resolvePluginSetupCliBackend({ backend: "codex-cli", env: {} })?.backend.id).toBe(
"codex-cli",
);
@@ -828,7 +824,6 @@ describe("setup-registry getJiti", () => {
env: {},
pluginIds: ["anthropic"],
});
expect(setupRegistryTesting.getCacheSizes().setupRegistry).toBe(0);
expect(loadSetupModule).toHaveBeenCalledTimes(7);
});
});

View File

@@ -84,20 +84,6 @@ const NOOP_LOGGER: PluginLogger = {
const jitiLoaders: PluginJitiLoaderCache = new Map();
export const __testing = {
get maxSetupLookupCacheEntries() {
return 0;
},
setMaxSetupLookupCacheEntriesForTest(_value?: number) {},
getCacheSizes() {
return {
setupRegistry: 0,
setupProvider: 0,
setupCliBackend: 0,
};
},
} as const;
export function clearPluginSetupRegistryCache(): void {
jitiLoaders.clear();
}