mirror of https://github.com/openclaw/openclaw.git
test(memory): clear browser and plugin caches between cases
This commit is contained in:
parent
ba95d43e3c
commit
7eefddd0ed
|
|
@ -22,7 +22,9 @@ beforeEach(async () => {
|
|||
await import("./server-context.remote-tab-ops.harness.js"));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
afterEach(async () => {
|
||||
const { closePlaywrightBrowserConnection } = await import("./pw-session.js");
|
||||
await closePlaywrightBrowserConnection().catch(() => {});
|
||||
globalThis.fetch = originalFetch;
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ import {
|
|||
originalFetch,
|
||||
} from "./server-context.remote-tab-ops.harness.js";
|
||||
|
||||
afterEach(() => {
|
||||
afterEach(async () => {
|
||||
const { closePlaywrightBrowserConnection } = await import("./pw-session.js");
|
||||
await closePlaywrightBrowserConnection().catch(() => {});
|
||||
globalThis.fetch = originalFetch;
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import {
|
|||
} from "../../../extensions/whatsapp/src/directory-config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { LineProbeResult } from "../../plugin-sdk/line.js";
|
||||
import { clearPluginDiscoveryCache } from "../../plugins/discovery.js";
|
||||
import { clearPluginManifestRegistryCache } from "../../plugins/manifest-registry.js";
|
||||
import { setActivePluginRegistry } from "../../plugins/runtime.js";
|
||||
import {
|
||||
createChannelTestPluginBase,
|
||||
|
|
@ -76,6 +78,8 @@ describe("channel plugin registry", () => {
|
|||
|
||||
afterEach(() => {
|
||||
setActivePluginRegistry(emptyRegistry);
|
||||
clearPluginDiscoveryCache();
|
||||
clearPluginManifestRegistryCache();
|
||||
});
|
||||
|
||||
it("sorts channel plugins by configured order", () => {
|
||||
|
|
@ -616,6 +620,8 @@ describe("channel plugin loader", () => {
|
|||
|
||||
afterEach(() => {
|
||||
setActivePluginRegistry(emptyRegistry);
|
||||
clearPluginDiscoveryCache();
|
||||
clearPluginManifestRegistryCache();
|
||||
});
|
||||
|
||||
it("loads channel plugins from the active registry", async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue