






















@@ -1,5 +1,5 @@
11import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2-import { __testing, resolveCliChannelOptions } from "./channel-options.js";
2+import { __testing, formatCliChannelOptions, resolveCliChannelOptions } from "./channel-options.js";
33import { __testing as startupMetadataTesting } from "./startup-metadata.js";
4455const readFileSyncMock = vi.hoisted(() => vi.fn());
@@ -17,10 +17,6 @@ vi.mock("node:fs", async () => {
1717};
1818});
191920-vi.mock("../channels/ids.js", () => ({
21-CHAT_CHANNEL_ORDER: ["quietchat", "forum"],
22-}));
23-2420describe("resolveCliChannelOptions", () => {
2521beforeEach(() => {
2622__testing.resetPrecomputedChannelOptionsForTests();
@@ -39,14 +35,17 @@ describe("resolveCliChannelOptions", () => {
3935);
40364137expect(resolveCliChannelOptions()).toEqual(["cached", "quietchat"]);
38+expect(formatCliChannelOptions(["all"])).toBe("all|cached|quietchat");
4239});
434044-it("falls back to core channel order when metadata is missing", () => {
41+it("falls back to generic channel text when metadata is missing", () => {
4542readFileSyncMock.mockImplementation(() => {
4643throw new Error("ENOENT");
4744});
484549-expect(resolveCliChannelOptions()).toEqual(["quietchat", "forum"]);
46+expect(resolveCliChannelOptions()).toEqual([]);
47+expect(formatCliChannelOptions()).toBe("channel");
48+expect(formatCliChannelOptions(["all"])).toBe("all");
5049});
51505251it("ignores external catalog env during CLI bootstrap", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。