mirror of https://github.com/openclaw/openclaw.git
test: trim extension teardown churn
This commit is contained in:
parent
376a042ba1
commit
9bba2ec0ad
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ describe("buildTelegramMessageContext DM topic threadId in deliveryContext (#889
|
|||
|
||||
afterEach(() => {
|
||||
clearRuntimeConfigSnapshot();
|
||||
recordInboundSessionMock.mockClear();
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ describe("buildTelegramMessageContext named-account DM fallback", () => {
|
|||
|
||||
afterEach(() => {
|
||||
clearRuntimeConfigSnapshot();
|
||||
recordInboundSessionMock.mockClear();
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue