ScenarioRunPackage.fromJson constructor

ScenarioRunPackage.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory ScenarioRunPackage.fromJson(Map<String, Object?> json) =>
    ScenarioRunPackage(
      path: json['path'] as String? ?? '',
      output: json['output'] as String? ?? '',
      axes: _stringsOrNull(json['axes']),
      ms: _int(json['ms'], 0),
      scenarios: _listOf(json['scenarios'], ScenarioRunOutcome.fromJson),
      report: json['report'] as String?,
      log: json['log'] as String?,
      error: json['error'] as String?,
      drift: switch (json['drift']) {
        Map<String, Object?> drift => ScenarioRunDrift.fromJson(drift),
        _ => null,
      },
      // Absent on a report written before they were counted, whose
      // scenarios are all present and can count themselves.
      passed: json['passed'] as int?,
      failed: json['failed'] as int?,
      skipped: json['skipped'] as int?,
      unsettledCount: json['unsettledCount'] as int?,
      scenariosElided: _int(json['scenariosElided'], 0),
      // Absent on every report from before there was a second clock.
      time: json['time'] as String? ?? 'fake',
      animations: (json['animations'] as num?)?.toDouble(),
    );