mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-29 04:57:09 +02:00
test: remove command extension mocks
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
import { vi } from "vitest";
|
||||
import type { MockFn } from "../test-utils/vitest-mock-fn.js";
|
||||
|
||||
function buildBundledPluginModuleId(pluginId: string, artifactBasename: string): string {
|
||||
return ["..", "..", "extensions", pluginId, artifactBasename].join("/");
|
||||
}
|
||||
|
||||
const readConfigFileSnapshotMock = vi.fn() as unknown as MockFn;
|
||||
const writeConfigFileMock = vi.fn().mockResolvedValue(undefined) as unknown as MockFn;
|
||||
const replaceConfigFileMock = vi.fn(async (params: { nextConfig: unknown }) => {
|
||||
@@ -54,7 +50,3 @@ vi.mock("../cli/command-config-resolution.js", () => ({
|
||||
vi.mock("../cli/command-secret-targets.js", () => ({
|
||||
getChannelsCommandSecretTargetIds: () => new Set<string>(),
|
||||
}));
|
||||
|
||||
vi.mock(buildBundledPluginModuleId("telegram", "update-offset-runtime-api.js"), () => ({
|
||||
deleteTelegramUpdateOffset: offsetMocks.deleteTelegramUpdateOffset,
|
||||
}));
|
||||
|
||||
@@ -16,10 +16,6 @@ let originalStateDir: string | undefined;
|
||||
let originalUpdateInProgress: string | undefined;
|
||||
let tempStateDir: string | undefined;
|
||||
|
||||
function buildBundledPluginModuleId(pluginId: string, artifactBasename: string): string {
|
||||
return ["..", "..", "extensions", pluginId, artifactBasename].join("/");
|
||||
}
|
||||
|
||||
function setStdinTty(value: boolean | undefined) {
|
||||
try {
|
||||
Object.defineProperty(process.stdin, "isTTY", {
|
||||
@@ -394,6 +390,16 @@ vi.mock("../agents/auth-profiles.js", async () => {
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("../agents/auth-profiles/store.js", async () => {
|
||||
const actual = await vi.importActual<typeof import("../agents/auth-profiles/store.js")>(
|
||||
"../agents/auth-profiles/store.js",
|
||||
);
|
||||
return {
|
||||
...actual,
|
||||
ensureAuthProfileStore,
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("../daemon/service.js", () => ({
|
||||
resolveGatewayService: () => ({
|
||||
label: "LaunchAgent",
|
||||
@@ -414,10 +420,6 @@ vi.mock("../pairing/pairing-store.js", () => ({
|
||||
upsertChannelPairingRequest: vi.fn().mockResolvedValue({ code: "000000", created: false }),
|
||||
}));
|
||||
|
||||
vi.mock(buildBundledPluginModuleId("telegram", "api.js"), () => ({
|
||||
resolveTelegramToken: vi.fn(() => ({ token: "", source: "none" })),
|
||||
}));
|
||||
|
||||
vi.mock("../runtime.js", () => ({
|
||||
defaultRuntime: {
|
||||
log: () => {},
|
||||
|
||||
Reference in New Issue
Block a user