Tests: remove resetModules crash from extension lanes
This commit is contained in:
parent
6a9b23d2b3
commit
15cccd6747
@ -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();
|
||||
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
import { Mock, vi } from "vitest";
|
||||
|
||||
vi.hoisted(() => {
|
||||
vi.resetModules();
|
||||
});
|
||||
|
||||
type SlackHandler = (args: unknown) => Promise<void>;
|
||||
type SlackProviderMonitor = (params: {
|
||||
botToken: string;
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
import { vi } from "vitest";
|
||||
|
||||
vi.hoisted(() => {
|
||||
vi.resetModules();
|
||||
});
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
dispatchMock: vi.fn(),
|
||||
readAllowFromStoreMock: vi.fn(),
|
||||
|
||||
@ -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", () => ({
|
||||
|
||||
@ -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", () => ({
|
||||
|
||||
@ -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" },
|
||||
|
||||
@ -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 () {
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.hoisted(() => {
|
||||
vi.resetModules();
|
||||
});
|
||||
|
||||
const {
|
||||
pushMessageMock,
|
||||
replyMessageMock,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user