test: remove command extension mocks

This commit is contained in:
Peter Steinberger
2026-04-20 21:43:01 +01:00
parent 1f816b1561
commit 43d5255998
2 changed files with 10 additions and 16 deletions

View File

@@ -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,
}));

View File

@@ -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: () => {},