Search categories, packages and repositories

Package detailsv2.0.2

junitreport

Generate JUnit XML reports from dart test runs. Transforms the output of dart or flutter tests to JUnit style XML

AndroidiOSWebmacOSWindowsLinux
30-day downloads
297K
Likes
36
Pub points
150

Install package

flutter pub add junitreport

Package Overview

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

The junitreport package generates JUnit XML format test reports from Dart or Flutter test runs. It transforms the default test output into a standardized XML structure compatible with CI/CD systems and testing dashboards. This enables seamless integration with tools like Jenkins, GitHub Actions, and other platforms that expect JUnit-style reporting. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform test automation workflows.

Use cases

  • CI/CD pipeline reporting
  • Integrating test results with Jenkins
  • Visualizing test outcomes in GitHub Actions
  • Automated test result aggregation
  • Cross-platform test reporting

Key features

  • Converts Dart test output to JUnit XML
  • Supports all Flutter platforms
  • Easy integration with CI systems
  • Lightweight and focused on reporting
  • Generates structured, machine-readable output

Suitable for

  • Teams using CI/CD pipelines
  • Test automation engineers
  • Projects requiring standardized test reporting
  • Developers integrating with Jenkins or GitHub Actions
  • Cross-platform Flutter applications

Considerations

  • Requires manual setup in test runner
  • Does not run tests—only formats output
  • May need additional configuration for complex test suites
  • Not intended for real-time test debugging
  • Output is static after test execution

Original README

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

JUnit Report

Introduction

This application can be used to convert the results of dart tests to JUnit xml reports. These XML reports can then be used by other tools like Jenkins CI.

By running

dart test simple_test.dart --reporter json > example.jsonl
dart pub global run junitreport:tojunit --input example.jsonl --output TEST-report.xml

and the contents of simple_test.dart is

import 'package:test/test.dart';

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

this program will generate 'TEST-report.xml' containing

<testsuites>
  <testsuite errors="0" failures="0" tests="1" skipped="0" name="simple" timestamp="2016-05-22T21:20:08">
    <properties>
      <property name="platform" value="vm" />
    </properties>
    <testcase classname="simple" name="simple" time="0.026" />
  </testsuite>
</testsuites>

For transforming Flutter tests reports, instead of passing --reporter json, you need to use --machine.

Installation

Run dart pub global activate junitreport to download the program and make a launch script available: <dart-cache>/bin/tojunit.

If the <dart-cache>/bin directory is not on your path, you will get a warning, including tips on how to fix it.

Once the directory is on your path, tojunit --help should be able to run and produce the program help.

Then you can also use the example above much simpler:

dart test simple_test.dart --reporter json | tojunit

And to run all tests for Flutter:

flutter test --machine | tojunit

License and contributors

Categories

Dependencies

Dependency list 4 items

Source repository

Projects using this package