























@@ -162,6 +162,10 @@ function setupOptions() {
162162);
163163}
164164165+function setupChannelArg(index: number) {
166+return mockArg(channelWizardMocks.setupChannels, 0, index, `setup channel arg ${index}`);
167+}
168+165169function applyAccountConfigCall(fn: MockCallSource, index = 0) {
166170return requireRecord(
167171mockArg(fn, index, 0, `apply account config ${index}`),
@@ -454,11 +458,9 @@ describe("channelsAddCommand", () => {
454458await channelsAddCommand({}, runtime, { hasFlags: false });
455459456460expect(channelWizardMocks.prompter.intro).toHaveBeenCalledWith("Channel setup");
457-expect(channelWizardMocks.setupChannels.mock.calls.at(0)?.[0]).toBe(config);
458-expect(channelWizardMocks.setupChannels.mock.calls.at(0)?.[1]).toBe(runtime);
459-expect(channelWizardMocks.setupChannels.mock.calls.at(0)?.[2]).toBe(
460-channelWizardMocks.prompter,
461-);
461+expect(setupChannelArg(0)).toBe(config);
462+expect(setupChannelArg(1)).toBe(runtime);
463+expect(setupChannelArg(2)).toBe(channelWizardMocks.prompter);
462464expect(setupOptions().deferStatusUntilSelection).toBe(true);
463465expect(setupOptions().skipStatusNote).toBe(true);
464466expect(setupOptions().promptAccountIds).toBe(true);
@@ -1027,7 +1029,10 @@ describe("channelsAddCommand", () => {
10271029expect(configMocks.writeConfigFile.mock.invocationCallOrder[0]).toBeLessThan(
10281030afterAccountConfigWritten.mock.invocationCallOrder[0] ?? Number.POSITIVE_INFINITY,
10291031);
1030-const hookCall = requireRecord(afterAccountConfigWritten.mock.calls.at(0)?.[0], "hook call");
1032+const hookCall = requireRecord(
1033+mockArg(afterAccountConfigWritten, 0, 0, "hook call"),
1034+"hook call",
1035+);
10311036expect(hookCall.previousCfg).toBe(baseConfigSnapshot.config);
10321037expect(requireRecord(hookCall.cfg, "hook config").channels).toEqual({
10331038signal: {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。