mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
d646a4e780
- Replaced hardcoded command paths with dynamic route mappings in E2E tests. - Enhanced documentation for command testing, specifying minimum route requirements. - Consolidated command path management into `topic-routes.ts` for better maintainability. - Updated various E2E test cases to utilize the new routing structure, ensuring consistency across tests. - Removed redundant helper functions and improved test clarity by directly referencing route exports.
34 lines
826 B
TypeScript
34 lines
826 B
TypeScript
import { defineCommand } from "bailian-cli-core";
|
||
import { createCli } from "bailian-cli-runtime";
|
||
import pkg from "../../package.json" with { type: "json" };
|
||
|
||
const noop = async () => {};
|
||
|
||
/** apiKey 域 stub:用于跨域 flag 拒绝测试 */
|
||
const textChat = defineCommand({
|
||
description: "runtime e2e stub",
|
||
auth: "apiKey",
|
||
flags: {
|
||
message: { type: "string", valueHint: "<m>", description: "message" },
|
||
},
|
||
run: noop,
|
||
});
|
||
|
||
/** console 域 stub:用于跨域 flag 拒绝测试 */
|
||
const mcpList = defineCommand({
|
||
description: "runtime e2e stub",
|
||
auth: "console",
|
||
flags: {},
|
||
run: noop,
|
||
});
|
||
|
||
void createCli(
|
||
{ "text chat": textChat, "mcp list": mcpList },
|
||
{
|
||
binName: "bl",
|
||
version: pkg.version,
|
||
clientName: "runtime-e2e",
|
||
npmPackage: "bailian-cli-runtime-e2e-harness",
|
||
},
|
||
).run();
|