Tests: remove resetModules crash from extension lanes

This commit is contained in:
joshavant 2026-03-17 17:04:57 -05:00
parent 6a9b23d2b3
commit 15cccd6747
No known key found for this signature in database
GPG Key ID: 4463B60B0DD49BC4
10 changed files with 0 additions and 40 deletions

View File

@ -2,10 +2,6 @@ import { ChannelType, type Client, type Message } from "@buape/carbon";
import { StickerFormatType } from "discord-api-types/v10";
import { beforeEach, describe, expect, it, vi } from "vitest";
vi.hoisted(() => {
vi.resetModules();
});
const fetchRemoteMedia = vi.fn();
const saveMediaBuffer = vi.fn();

View File

@ -46,10 +46,6 @@ import {
resolveDiscordReplyDeliveryPlan,
} from "./threading.js";
vi.hoisted(() => {
vi.resetModules();
});
const readAllowFromStoreMock = vi.hoisted(() => vi.fn());
const upsertPairingRequestMock = vi.hoisted(() => vi.fn());
const enqueueSystemEventMock = vi.hoisted(() => vi.fn());

View File

@ -3,10 +3,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../../../../src/config/config.js";
import type { ThreadBindingRecord } from "./thread-bindings.types.js";
vi.hoisted(() => {
vi.resetModules();
});
const hoisted = vi.hoisted(() => {
const restGet = vi.fn();
const sendMessageDiscord = vi.fn();

View File

@ -1,9 +1,5 @@
import { Mock, vi } from "vitest";
vi.hoisted(() => {
vi.resetModules();
});
type SlackHandler = (args: unknown) => Promise<void>;
type SlackProviderMonitor = (params: {
botToken: string;

View File

@ -1,9 +1,5 @@
import { vi } from "vitest";
vi.hoisted(() => {
vi.resetModules();
});
const mocks = vi.hoisted(() => ({
dispatchMock: vi.fn(),
readAllowFromStoreMock: vi.fn(),

View File

@ -2,10 +2,6 @@ import type { MessageEvent, PostbackEvent } from "@line/bot-sdk";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { LineAccountConfig } from "./types.js";
vi.hoisted(() => {
vi.resetModules();
});
// Avoid pulling in globals/pairing/media dependencies; this suite only asserts
// allowlist/groupPolicy gating and message-context wiring.
vi.mock("../globals.js", () => ({

View File

@ -3,10 +3,6 @@ import path from "node:path";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js";
vi.hoisted(() => {
vi.resetModules();
});
const getMessageContentMock = vi.hoisted(() => vi.fn());
vi.mock("@line/bot-sdk", () => ({

View File

@ -2,10 +2,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import type { RuntimeEnv } from "../runtime.js";
vi.hoisted(() => {
vi.resetModules();
});
const { createLineBotMock, registerPluginHttpRouteMock, unregisterHttpMock } = vi.hoisted(() => ({
createLineBotMock: vi.fn(() => ({
account: { accountId: "default" },

View File

@ -1,9 +1,5 @@
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
vi.hoisted(() => {
vi.resetModules();
});
const { getBotInfoMock, MessagingApiClientMock } = vi.hoisted(() => {
const getBotInfoMock = vi.fn();
const MessagingApiClientMock = vi.fn(function () {

View File

@ -1,9 +1,5 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
vi.hoisted(() => {
vi.resetModules();
});
const {
pushMessageMock,
replyMessageMock,