junitreport 0.3.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 63

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.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

<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.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.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 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.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

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
25 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
63
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0
args ^0.13.7 0.13.7 1.4.3
intl ^0.15.0 0.15.6
testreport ^0.3.0 0.3.0
xml ^2.6.0 2.6.0 3.0.0
Transitive dependencies
matcher 0.12.3
path 1.6.1
petitparser 1.7.6
stack_trace 1.9.2
Dev dependencies
test any