test(browser): drop redundant module resets

This commit is contained in:
Vincent Koc
2026-04-03 20:43:04 +09:00
parent 6e3eb34a90
commit 9a53c3d772
2 changed files with 3 additions and 10 deletions

View File

@@ -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,

View File

@@ -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"] {