junitreport 0.3.0

  • README.md
  • Installing
  • Versions
  • 50

JUnit Report


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

pub run test simple_test.dart --reporter json > example.json
pub global run junitreport:tojunit --input example.json --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

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


Run 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:

pub run test simple_test.dart --reporter json | tojunit

License and contributors


  • updated dependencies:
    • sdk: '>=1.19.0 <2.0.0'
    • xml: '^2.6.0'
    • intl: '^0.15.0'
    • testreport: '^0.3.0'
  • removed transitive dependencies on 'build_collection' and 'quiver'


  • restrict dependency on xml to '>= 2.5.0 <2.6.0' because the XmlPrettyWriter moved to a different library
  • use one system-out element to contain all outputs instead of one per output


  • Initial implementation

1. Depend on it

Add this to your package's pubspec.yaml file:

  junitreport: "^0.3.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:junitreport/junitreport.dart';
Version Uploaded Documentation Archive
0.3.0 Sep 20, 2017 Go to the documentation of junitreport 0.3.0 Download junitreport 0.3.0 archive
0.2.1 Sep 20, 2017 Go to the documentation of junitreport 0.2.1 Download junitreport 0.2.1 archive
0.2.0 Jun 2, 2016 Go to the documentation of junitreport 0.2.0 Download junitreport 0.2.0 archive
0.1.0 May 22, 2016 Go to the documentation of junitreport 0.1.0 Download junitreport 0.1.0 archive


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:junitreport/junitreport.dart.


  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use junitreport.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0
args ^0.13.7 0.13.7 1.3.0
intl ^0.15.0 0.15.2
testreport ^0.3.0 0.3.0
xml ^2.6.0 2.6.0 3.0.0-alpha
Transitive dependencies
matcher 0.12.1+4
path 1.5.1
petitparser 1.7.0
stack_trace 1.9.1
Dev dependencies
test any