MCPcopy Index your code
hub / github.com/callstack/agent-device / assertBackgroundExecTraceEvents

Function assertBackgroundExecTraceEvents

src/utils/__tests__/exec.test.ts:346–372  ·  view source on GitHub ↗
(
  execEvents: Array<{
    level?: string;
    phase?: string;
    durationMs?: number;
    data?: Record<string, unknown>;
  }>,
)

Source from the content-addressed store, hash-verified

344}
345
346function assertBackgroundExecTraceEvents(
347 execEvents: Array<{
348 level?: string;
349 phase?: string;
350 durationMs?: number;
351 data?: Record<string, unknown>;
352 }>,
353): void {
354 assert.deepEqual(execEvents.map(summarizeExecEvent), [
355 {
356 phase: 'exec_command',
357 command: process.execPath,
358 event: 'spawn',
359 durationType: 'undefined',
360 argsPrefix: ['-e', 'process.stdout.write("ok")', 'a', 'b', 'c', 'd'],
361 omittedArgCount: 2,
362 },
363 {
364 phase: 'exec_command',
365 command: process.execPath,
366 event: 'exit',
367 durationType: 'number',
368 argsPrefix: ['-e', 'process.stdout.write("ok")', 'a', 'b', 'c', 'd'],
369 omittedArgCount: 2,
370 },
371 ]);
372}
373
374function summarizeExecEvent(event: {
375 phase?: string;

Callers 1

exec.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected