toJson method
Implementation
Map<String, Object?> toJson() => {
'path': path,
'output': output,
if (axes != null) 'axes': axes,
'ms': ms,
// Only for a package that ran: one that did not has an `error` and no
// scenarios, and `passed: 0` beside it would read as a verdict.
if (error == null) 'passed': passed,
if (error == null) 'failed': failed,
if (skipped > 0) 'skipped': skipped,
if (unsettledCount > 0) 'unsettledCount': unsettledCount,
'scenarios': scenarios,
if (scenariosElided > 0) 'scenariosElided': scenariosElided,
if (report != null) 'report': report,
if (log != null) 'log': log,
if (error != null) 'error': error,
if (drift != null) 'drift': drift!.toJson(),
if (time != 'fake') 'time': time,
if (animations != null) 'animations': animations,
};