Search categories, packages and repositories

Package detailsv2.0.1

testreport

This library can be used to process the results of dart tests. It processes data from the `json` output emitted by the dart test runner and provide an API to the test results.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
347K
Likes
3
Pub points
160

Install package

flutter pub add testreport

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The testreport package processes Dart test results from JSON output generated by the Dart test runner. It provides a structured API to parse, analyze, and extract meaningful information from test outcomes, such as pass/fail status, durations, and errors. This is particularly useful for integrating test results into CI/CD pipelines, generating reports, or visualizing test performance across platforms. The library supports all major Flutter platforms, making it ideal for cross-platform testing workflows.

Use cases

  • CI/CD integration
  • Test result analysis
  • Automated reporting
  • Cross-platform testing
  • Test dashboarding

Key features

  • JSON result parsing
  • Platform-agnostic
  • Error and duration extraction
  • Structured data API
  • Supports all Flutter platforms

Suitable for

  • CI/CD systems
  • Test automation teams
  • Quality assurance engineers
  • Developers using Flutter
  • Reporting tools

Considerations

  • Requires JSON output from dart test runner
  • Limited to post-test processing
  • No real-time test monitoring
  • Dependent on test runner output format
  • Not for running tests directly

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Test Report

Introduction

This library can be used to process the results of dart tests.

The goal of this library is to process the data from the json output emitted by the dart test runner and provide an API to the interpreted test results.

Purpose

By running

pub run test simple_test.dart --reporter json

and the contents of simple_test.dart is

import 'package:test/test.dart';

main() {
  test('simple', () {
    expect(true, true);
  });
}

the dart test runner will output the results of the test in json format as a stream of events:

{"protocolVersion":"0.1.0","runnerVersion":"0.12.13+1","type":"start","time":0}
{"count":1,"type":"allSuites","time":0}
{"suite":{"id":0,"platform":"vm","path":"simple_test.dart"},"type":"suite","time":0}
{"test":{"id":1,"name":"loading simple_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null}},"type":"testStart","time":0}
{"testID":1,"result":"success","hidden":true,"type":"testDone","time":237}
{"group":{"id":2,"suiteID":0,"parentID":null,"name":null,"metadata":{"skip":false,"skipReason":null},"testCount":1},"type":"group","time":241}
{"test":{"id":3,"name":"simple","suiteID":0,"groupIDs":[2],"metadata":{"skip":false,"skipReason":null}},"type":"testStart","time":242}
{"testID":3,"result":"success","hidden":false,"type":"testDone","time":268}
{"success":true,"type":"done","time":271}

From this json output, it is not easy to see how many tests were executed, how many failed and how much time was spent in each test.

The Processor in this project takes the json events, and turns them into a Report, that is suitable for further processing.

License and contributors

Categories

Source repository

Projects using this package