mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:40:44 +00:00
test: reset installed manifest cache in web search provider tests
This commit is contained in:
@@ -4,6 +4,7 @@ type RegistryModule = typeof import("./registry.js");
|
||||
type RuntimeModule = typeof import("./runtime.js");
|
||||
type WebSearchProvidersRuntimeModule = typeof import("./web-search-providers.runtime.js");
|
||||
type ManifestRegistryModule = typeof import("./manifest-registry.js");
|
||||
type InstalledManifestRegistryModule = typeof import("./manifest-registry-installed.js");
|
||||
type PluginAutoEnableModule = typeof import("../config/plugin-auto-enable.js");
|
||||
type WebSearchProvidersSharedModule = typeof import("./web-search-providers.shared.js");
|
||||
|
||||
@@ -25,6 +26,7 @@ let setActivePluginRegistry: RuntimeModule["setActivePluginRegistry"];
|
||||
let resolvePluginWebSearchProviders: WebSearchProvidersRuntimeModule["resolvePluginWebSearchProviders"];
|
||||
let resolveRuntimeWebSearchProviders: WebSearchProvidersRuntimeModule["resolveRuntimeWebSearchProviders"];
|
||||
let resetWebSearchProviderSnapshotCacheForTests: WebSearchProvidersRuntimeModule["__testing"]["resetWebSearchProviderSnapshotCacheForTests"];
|
||||
let clearInstalledManifestRegistryCache: InstalledManifestRegistryModule["clearInstalledManifestRegistryCache"];
|
||||
let loadOpenClawPluginsMock: ReturnType<typeof vi.fn>;
|
||||
let loaderModule: typeof import("./loader.js");
|
||||
let manifestRegistryModule: ManifestRegistryModule;
|
||||
@@ -343,6 +345,7 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
loaderModule = await import("./loader.js");
|
||||
pluginAutoEnableModule = await import("../config/plugin-auto-enable.js");
|
||||
webSearchProvidersSharedModule = await import("./web-search-providers.shared.js");
|
||||
({ clearInstalledManifestRegistryCache } = await import("./manifest-registry-installed.js"));
|
||||
({ setActivePluginRegistry } = await import("./runtime.js"));
|
||||
({
|
||||
resolvePluginWebSearchProviders,
|
||||
@@ -353,6 +356,7 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
resetWebSearchProviderSnapshotCacheForTests();
|
||||
clearInstalledManifestRegistryCache();
|
||||
applyPluginAutoEnableSpy?.mockRestore();
|
||||
applyPluginAutoEnableSpy = vi
|
||||
.spyOn(pluginAutoEnableModule, "applyPluginAutoEnable")
|
||||
@@ -385,6 +389,7 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
clearInstalledManifestRegistryCache();
|
||||
setActivePluginRegistry(createEmptyPluginRegistry());
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user