fix(cli): add config alias and reduce probe noise

This commit is contained in:
Peter Steinberger
2026-01-04 17:23:24 +00:00
parent 9eee832282
commit 2110cac5d6
6 changed files with 20 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
const sendCommand = vi.fn();
const statusCommand = vi.fn();
const configureCommand = vi.fn();
const loginWeb = vi.fn();
const callGateway = vi.fn();
@@ -16,6 +17,7 @@ const runtime = {
vi.mock("../commands/send.js", () => ({ sendCommand }));
vi.mock("../commands/status.js", () => ({ statusCommand }));
vi.mock("../commands/configure.js", () => ({ configureCommand }));
vi.mock("../runtime.js", () => ({ defaultRuntime: runtime }));
vi.mock("../provider-web.js", () => ({
loginWeb,
@@ -49,7 +51,13 @@ describe("cli program", () => {
expect(statusCommand).toHaveBeenCalled();
});
it("runs nodes list and calls node.pair.list", async () => {
it("runs config alias as configure", async () => {
const program = buildProgram();
await program.parseAsync(["config"], { from: "user" });
expect(configureCommand).toHaveBeenCalled();
});
it("runs nodes list and calls node.pair.list", async () => {
callGateway.mockResolvedValue({ pending: [], paired: [] });
const program = buildProgram();
runtime.log.mockClear();