junitreport 0.3.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 57

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

pub run test simple_test.dart --reporter json > example.jsonl
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>

Installation

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

0.3.3

  • more dart 2.0 support

0.3.2

  • updated dependencies:
    • testreport: '^0.3.1'

0.3.1

  • support for Dart 2.0
  • updated dependencies:
    • xml: '^3.0.0'
    • intl: '^0.15.5'
    • args: '^1.4.4'

0.3.0

  • 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'

0.2.1

  • 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

0.1.0

  • Initial implementation

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate junitreport

2. Use it

The package has the following executables:


$ tojunit

Use this package as a library

1. Depend on it

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


dependencies:
  junitreport: ^0.3.3

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 flutter 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.3 Sep 3, 2018 Go to the documentation of junitreport 0.3.3 Download junitreport 0.3.3 archive
0.3.2 Jul 20, 2018 Go to the documentation of junitreport 0.3.2 Download junitreport 0.3.2 archive
0.3.1 Jul 19, 2018 Go to the documentation of junitreport 0.3.1 Download junitreport 0.3.1 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
0.3.1-dev Jul 19, 2018 Go to the documentation of junitreport 0.3.1-dev Download junitreport 0.3.1-dev archive
Popularity:
Describes how popular the package is relative to other packages. [more]
31
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
57
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

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

Health issues and suggestions

Document public APIs (-10 points)

3 out of 3 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Format bin/tojunit.dart.

Run dartfmt to format bin/tojunit.dart.

Maintenance suggestions

The description is too short. (-20 points)

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

Maintain an example. (-10 points)

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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
args ^1.4.4 1.5.1
intl ^0.15.5 0.15.7
testreport ^0.3.1 0.3.1
xml ^3.0.0 3.2.3
Transitive dependencies
collection 1.14.11
path 1.6.2
petitparser 2.0.2
Dev dependencies
test any