mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 21:51:28 +00:00
test(browser): drop redundant module resets
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
import type { ChildProcessWithoutNullStreams } from "node:child_process";
|
||||
import { EventEmitter } from "node:events";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.hoisted(() => {
|
||||
vi.resetModules();
|
||||
});
|
||||
|
||||
import "./server-context.chrome-test-harness.js";
|
||||
import {
|
||||
PROFILE_ATTACH_RETRY_TIMEOUT_MS,
|
||||
|
||||
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createProfileResetOps } from "./server-context.reset.js";
|
||||
|
||||
const trashMocks = vi.hoisted(() => ({
|
||||
movePathToTrash: vi.fn(async (from: string) => `${from}.trashed`),
|
||||
@@ -14,15 +15,12 @@ const pwAiMocks = vi.hoisted(() => ({
|
||||
vi.mock("./trash.js", () => trashMocks);
|
||||
vi.mock("./pw-ai.js", () => pwAiMocks);
|
||||
|
||||
let createProfileResetOps: typeof import("./server-context.reset.js").createProfileResetOps;
|
||||
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
({ createProfileResetOps } = await import("./server-context.reset.js"));
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
function localOpenClawProfile(): Parameters<typeof createProfileResetOps>[0]["profile"] {
|
||||
|
||||
Reference in New Issue
Block a user