mirror of https://github.com/openclaw/openclaw.git
test: speed up browser and gateway suites
This commit is contained in:
parent
435e2c5967
commit
a8bf75f03e
|
|
@ -1,6 +1,6 @@
|
|||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { BrowserRouteContext, BrowserServerState } from "./server-context.js";
|
||||
|
||||
vi.mock("../config/config.js", async (importOriginal) => {
|
||||
|
|
@ -58,10 +58,13 @@ async function createWorkProfileWithConfig(params: {
|
|||
}
|
||||
|
||||
describe("BrowserProfilesService", () => {
|
||||
beforeEach(async () => {
|
||||
beforeAll(async () => {
|
||||
vi.resetModules();
|
||||
({ resolveBrowserConfig } = await import("./config.js"));
|
||||
({ createBrowserProfilesService } = await import("./profiles-service.js"));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Buffer } from "node:buffer";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { DeviceIdentity } from "../infra/device-identity.js";
|
||||
import { captureEnv } from "../test-utils/env.js";
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ function expectSecurityConnectError(
|
|||
}
|
||||
}
|
||||
|
||||
beforeEach(async () => {
|
||||
beforeAll(async () => {
|
||||
await loadGatewayClientModule();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue