MCPcopy
hub / github.com/callstack/agent-device / writeGenericCliOutput

Function writeGenericCliOutput

src/cli/commands/generic.ts:50–71  ·  view source on GitHub ↗
(
  command: ClientBackedCliCommandName,
  flags: CliFlags,
  data: CommandRequestResult,
  options: Pick<ClientCommandParams, 'debug' | 'replayTestReporterRuntime'> = {},
)

Source from the content-addressed store, hash-verified

48}
49
50function writeGenericCliOutput(
51 command: ClientBackedCliCommandName,
52 flags: CliFlags,
53 data: CommandRequestResult,
54 options: Pick<ClientCommandParams, 'debug' | 'replayTestReporterRuntime'> = {},
55): Promise<number> | number {
56 if (command === 'test') {
57 return renderReplayTestResponse({
58 suite: data as ReplaySuiteResult,
59 debug: options.debug,
60 verbose: flags.verbose,
61 json: flags.json,
62 reporter: flags.reporter,
63 reportJunit: flags.reportJunit,
64 reporterRuntime: options.replayTestReporterRuntime,
65 });
66 }
67 writeCommandOutput(flags, data, () =>
68 readCommandMessage(data as Record<string, unknown> | undefined),
69 );
70 return 0;
71}
72
73function writeCliOutput(flags: CliFlags, output: CliOutput): void {
74 if (!flags.json && output.stderr) {

Callers 1

Calls 3

renderReplayTestResponseFunction · 0.90
writeCommandOutputFunction · 0.90
readCommandMessageFunction · 0.90

Tested by

no test coverage detected