mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
18 lines
607 B
TypeScript
18 lines
607 B
TypeScript
import { expect, test } from "vite-plus/test";
|
|
import { captureRegistryHelp } from "../src/registry-smoke.ts";
|
|
|
|
test("captureRegistryHelp 捕获指定命令路径的非 TTY 输出", () => {
|
|
const requestedPaths: string[][] = [];
|
|
const renderer = {
|
|
printHelp(commandPath: string[], output: NodeJS.WriteStream): void {
|
|
requestedPaths.push(commandPath);
|
|
output.write(`Usage: bl ${commandPath.join(" ")}`);
|
|
},
|
|
};
|
|
|
|
const output = captureRegistryHelp(renderer, ["text", "chat"]);
|
|
|
|
expect(output).toBe("Usage: bl text chat");
|
|
expect(requestedPaths).toEqual([["text", "chat"]]);
|
|
});
|