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

Function recordStep

test/integration/smoke-web-platform.test.ts:244–262  ·  view source on GitHub ↗
(
  context: WebSmokeContext,
  step: string,
  args: string[],
  result: CliJsonResult,
)

Source from the content-addressed store, hash-verified

242}
243
244function recordStep(
245 context: WebSmokeContext,
246 step: string,
247 args: string[],
248 result: CliJsonResult,
249): void {
250 const errorCode =
251 typeof result.json?.error?.code === 'string' ? result.json.error.code : undefined;
252 const errorMessage =
253 typeof result.json?.error?.message === 'string' ? result.json.error.message : undefined;
254 context.stepHistory.push({
255 step,
256 command: `agent-device ${args.join(' ')}`,
257 status: result.status,
258 timestamp: new Date().toISOString(),
259 errorCode,
260 errorMessage,
261 });
262}
263
264function maybeCaptureSnapshot(
265 context: WebSmokeContext,

Callers 1

runStepFunction · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected