| 344 | } |
| 345 | |
| 346 | function 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 | |
| 374 | function summarizeExecEvent(event: { |
| 375 | phase?: string; |