mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 14:41:34 +00:00
fix(ci): stabilize browser bundled integration tests
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createBundledBrowserPluginFixture } from "../../test/helpers/browser-bundled-plugin-fixture.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { clearPluginDiscoveryCache } from "../plugins/discovery.js";
|
||||
import { clearPluginLoaderCache } from "../plugins/loader.js";
|
||||
import { clearPluginManifestRegistryCache } from "../plugins/manifest-registry.js";
|
||||
import { resetPluginRuntimeStateForTest } from "../plugins/runtime.js";
|
||||
@@ -9,6 +11,7 @@ import { loadGatewayStartupPlugins } from "./server-plugin-bootstrap.js";
|
||||
|
||||
function resetPluginState() {
|
||||
clearPluginLoaderCache();
|
||||
clearPluginDiscoveryCache();
|
||||
clearPluginManifestRegistryCache();
|
||||
resetPluginRuntimeStateForTest();
|
||||
}
|
||||
@@ -23,12 +26,19 @@ function createTestLog() {
|
||||
}
|
||||
|
||||
describe("loadGatewayStartupPlugins browser plugin integration", () => {
|
||||
let bundledFixture: ReturnType<typeof createBundledBrowserPluginFixture> | null = null;
|
||||
|
||||
beforeEach(() => {
|
||||
bundledFixture = createBundledBrowserPluginFixture();
|
||||
vi.stubEnv("OPENCLAW_BUNDLED_PLUGINS_DIR", bundledFixture.rootDir);
|
||||
resetPluginState();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
resetPluginState();
|
||||
vi.unstubAllEnvs();
|
||||
bundledFixture?.cleanup();
|
||||
bundledFixture = null;
|
||||
});
|
||||
|
||||
it("adds browser.request and the browser control service from the bundled plugin", () => {
|
||||
|
||||
Reference in New Issue
Block a user