fix: keep channel CLI helpers private

This commit is contained in:
Shakker
2026-07-15 13:05:10 +01:00
committed by Shakker
parent b08b699de2
commit 24c753ae31
2 changed files with 2 additions and 22 deletions
+1 -21
View File
@@ -3,7 +3,7 @@ import { Command } from "commander";
import { afterEach, describe, expect, it, vi } from "vitest";
import type { PluginPackageChannel } from "../plugins/manifest.js";
import { mockProcessPlatform } from "../test-utils/vitest-spies.js";
import { registerChannelsCli, resolveChannelsAddOptions } from "./channels-cli.js";
import { registerChannelsCli } from "./channels-cli.js";
const listBundledPackageChannelMetadataMock = vi.hoisted(() =>
vi.fn<() => readonly PluginPackageChannel[]>(() => []),
@@ -106,23 +106,3 @@ describe("registerChannelsCli", () => {
expect(getChannelAddOptionFlags(program)).toContain("--homeserver <url>");
});
});
describe("resolveChannelsAddOptions", () => {
it("accepts a positional channel while preserving --channel precedence", () => {
expect(
resolveChannelsAddOptions("clickclack", {
baseUrl: "https://clickclack.example",
token: "ccb_test",
workspace: "default",
}),
).toEqual({
channel: "clickclack",
baseUrl: "https://clickclack.example",
token: "ccb_test",
workspace: "default",
});
expect(resolveChannelsAddOptions("clickclack", { channel: "telegram" })).toEqual({
channel: "telegram",
});
});
});
+1 -1
View File
@@ -51,7 +51,7 @@ function getOptionNames(command: Command): string[] {
return command.options.map((option) => option.attributeName());
}
export function resolveChannelsAddOptions(
function resolveChannelsAddOptions(
channelArg: string | undefined,
opts: Record<string, unknown>,
): Record<string, unknown> {