mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-23 14:45:46 +00:00
test: trim command install partial mocks
This commit is contained in:
@@ -5,8 +5,8 @@ import {
|
||||
bundledPluginRootAt,
|
||||
} from "../../../test/helpers/bundled-plugin-paths.js";
|
||||
|
||||
vi.mock("node:fs", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("node:fs")>();
|
||||
vi.mock("node:fs", async () => {
|
||||
const actual = await vi.importActual<typeof import("node:fs")>("node:fs");
|
||||
const existsSync = vi.fn();
|
||||
return {
|
||||
...actual,
|
||||
@@ -30,8 +30,10 @@ vi.mock("../../config/plugin-auto-enable.js", () => ({
|
||||
|
||||
const resolveBundledPluginSources = vi.fn();
|
||||
const getChannelPluginCatalogEntry = vi.fn();
|
||||
vi.mock("../../channels/plugins/catalog.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("../../channels/plugins/catalog.js")>();
|
||||
vi.mock("../../channels/plugins/catalog.js", async () => {
|
||||
const actual = await vi.importActual<typeof import("../../channels/plugins/catalog.js")>(
|
||||
"../../channels/plugins/catalog.js",
|
||||
);
|
||||
return {
|
||||
...actual,
|
||||
getChannelPluginCatalogEntry: (...args: unknown[]) => getChannelPluginCatalogEntry(...args),
|
||||
|
||||
@@ -6,8 +6,9 @@ import { vi } from "vitest";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
|
||||
export function mockSessionsConfig() {
|
||||
vi.mock("../config/config.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("../config/config.js")>();
|
||||
vi.mock("../config/config.js", async () => {
|
||||
const actual =
|
||||
await vi.importActual<typeof import("../config/config.js")>("../config/config.js");
|
||||
return {
|
||||
...actual,
|
||||
loadConfig: () => ({
|
||||
|
||||
Reference in New Issue
Block a user