(
step: string,
args: string[],
result: CliJsonResult,
message: string,
assertionDetail?: string,
)
| 217 | } |
| 218 | |
| 219 | function writeFailureArtifacts( |
| 220 | step: string, |
| 221 | args: string[], |
| 222 | result: CliJsonResult, |
| 223 | message: string, |
| 224 | assertionDetail?: string, |
| 225 | ): void { |
| 226 | const dir = ensureArtifactDir(); |
| 227 | writeFileSync(path.join(dir, 'failed-step.txt'), message); |
| 228 | writeFileSync( |
| 229 | path.join(dir, 'failed-step.json'), |
| 230 | JSON.stringify( |
| 231 | { |
| 232 | step, |
| 233 | command: `agent-device ${args.join(' ')}`, |
| 234 | assertionDetail, |
| 235 | result, |
| 236 | occurredAt: new Date().toISOString(), |
| 237 | }, |
| 238 | null, |
| 239 | 2, |
| 240 | ), |
| 241 | ); |
| 242 | writeFileSync(path.join(dir, 'step-history.json'), JSON.stringify(stepHistory, null, 2)); |
| 243 | if (lastSnapshot) { |
| 244 | writeFileSync( |
| 245 | path.join(dir, 'last-snapshot.json'), |
| 246 | JSON.stringify(lastSnapshot.rawJson, null, 2), |
| 247 | ); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | return { |
| 252 | runStep, |
no test coverage detected