Skip to content

joaovieira/junit-report-merger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

junit-report-merger

NPM version NPM downloads Dependencies Dev. Dependencies MIT License Build Status

Merges multiple JUnit XML reports into one.

JUnit XML reports are generated by reporters for popular testing frameworks, such as mocha-junit-reporter and karma-junit-reporter. Other packages also may store test results in JUnit XML format.

junit-report-merger creates a new test results report in JUnit XML format by collecting all <testsuite> elements from all XML reports and putting them together.

This can be useful when you have multiple test runners in your test pipeline but you need a single output file which includes results from all test runners.

API

Package exports a single object with the following methods.

mergeFiles(destFilePath, srcFilePaths, [options], cb)

Reads multiple files, merges their contents and write into the given file.

mergeStreams(destStream, srcStreams, [options], cb)

Reads multiple streams, merges their contents and write into the given stream.

mergeToString(srcStrings, [options])String

Merges contents of given XML strings and returns resulting XML string.

mergeFiles(destFilePath, srcFilePaths, [options], cb)

Reads multiple files, merges their contents and write into the given file.

Param Type Description
destFilePath String Where the output should be stored. Denotes a path to file. If file already exists, it will be overwritten.
srcFilePaths Array.<String> Paths to the files which should be merged.
[options] Object Merge options. Currently unused.
cb function Callback function which will be called at completion. Will receive error as first argument if any.

mergeStreams(destStream, srcStreams, [options], cb)

Reads multiple streams, merges their contents and write into the given stream.

Param Type Description
destStream WriteStream A stream which will be used to write the merge result.
srcStreams Array.<ReadStream> Streams which will be used to read data from.
[options] Object Merge options. Currently unused.
cb function Callback function which will be called at completion. Will receive error as first argument if any.

mergeToString(srcStrings, [options]) ⇒ String

Merges contents of given XML strings and returns resulting XML string.

Param Type Description
srcStrings Array.<String> Array of strings to merge together.
[options] Object Merge options. Currently unused.

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About

Merges multiple JUnit XML reports into one

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%