test: trim extension teardown churn

This commit is contained in:
Peter Steinberger 2026-04-03 07:14:23 +01:00
parent 376a042ba1
commit 9bba2ec0ad
No known key found for this signature in database
6 changed files with 4 additions and 23 deletions

View File

@ -1,5 +1,5 @@
import fs from "node:fs";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { BrowserServerState } from "./server-context.js";
vi.mock("./chrome-mcp.js", () => ({
@ -58,10 +58,6 @@ function makeState(): BrowserServerState {
};
}
afterEach(() => {
vi.clearAllMocks();
});
beforeAll(async () => {
({ createBrowserRouteContext } = await import("./server-context.js"));
chromeMcp = await import("./chrome-mcp.js");

View File

@ -1,5 +1,5 @@
import { EventEmitter } from "node:events";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
vi.mock("openclaw/plugin-sdk/runtime-env", () => ({
logVerbose: vi.fn(),
@ -23,11 +23,6 @@ describe("attachDiscordGatewayLogging", () => {
beforeEach(() => {
vi.clearAllMocks();
});
afterEach(() => {
vi.clearAllMocks();
});
it("logs debug events and promotes reconnect/close to info", () => {
const emitter = new EventEmitter();
const runtime = makeRuntime();

View File

@ -1,4 +1,4 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
const runFfprobeMock = vi.hoisted(() => vi.fn<(...args: unknown[]) => Promise<string>>());
const runFfmpegMock = vi.hoisted(() => vi.fn<(...args: unknown[]) => Promise<void>>());
@ -36,12 +36,6 @@ describe("ensureOggOpus", () => {
runFfprobeMock.mockReset();
runFfmpegMock.mockReset();
});
afterEach(() => {
runFfprobeMock.mockReset();
runFfmpegMock.mockReset();
});
it("rejects URL/protocol input paths", async () => {
await expect(ensureOggOpus("https://example.com/audio.ogg")).rejects.toThrow(
/local file path/i,

View File

@ -1,4 +1,4 @@
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { PluginRuntime } from "../../runtime-api.js";
import { setMatrixRuntime } from "../runtime.js";
import { voteMatrixPoll } from "./actions/polls.js";
@ -147,8 +147,6 @@ function resetMatrixSendRuntimeMocks() {
}
describe("sendMessageMatrix media", () => {
beforeAll(() => {});
beforeEach(() => {
resetMatrixSendRuntimeMocks();
});

View File

@ -46,7 +46,6 @@ describe("buildTelegramMessageContext DM topic threadId in deliveryContext (#889
afterEach(() => {
clearRuntimeConfigSnapshot();
recordInboundSessionMock.mockClear();
});
beforeAll(async () => {

View File

@ -18,7 +18,6 @@ describe("buildTelegramMessageContext named-account DM fallback", () => {
afterEach(() => {
clearRuntimeConfigSnapshot();
recordInboundSessionMock.mockClear();
});
beforeAll(async () => {