(step: string, args: string[], result: CliJsonResult)
| 88 | } |
| 89 | |
| 90 | function recordStep(step: string, args: string[], result: CliJsonResult): void { |
| 91 | const errorCode = |
| 92 | typeof result.json?.error?.code === 'string' ? (result.json.error.code as string) : undefined; |
| 93 | const errorMessage = |
| 94 | typeof result.json?.error?.message === 'string' |
| 95 | ? (result.json.error.message as string) |
| 96 | : undefined; |
| 97 | stepHistory.push({ |
| 98 | step, |
| 99 | command: `agent-device ${args.join(' ')}`, |
| 100 | status: result.status, |
| 101 | timestamp: new Date().toISOString(), |
| 102 | errorCode, |
| 103 | errorMessage, |
| 104 | }); |
| 105 | } |
| 106 | |
| 107 | function assertResult( |
| 108 | condition: unknown, |
no test coverage detected