1.0.3 • Published 12 months ago

tap-reporter v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

tap-reporter

Format a TAP stream using a different set of reporters, mainly Mocha's.

The main reporter outside the mocha reporters is sonarqube. This reporter generates a Generic Execution Data, complatible with SonarQube.

Disclaimer

This package is a fork of tap-mocha-reporter. We decide to fork and publish this package because it seems all the open Pull Requests does not have activity in the last years. In any case, we acknowledgement the great job of the contributors of tap-mocha-reporter <3.

Getting started

Install the package using npm:

npm i tap-reporter

Usage

You need to specify a reporter with the first argument.

tap test/*.js | tap-reporter <reporter> [--options]

Programmatically, you can use this as a transform stream.

var TSR = require('tap-reporter');

fs.createReadStream('saved-test-output.tap').pipe(TSR('sonarqube'));

Options

--output (-o)

It generates a file with the output report.

tap test/\*.js | tap-reporter sonarqube --output tests-execution.xml

The reporters type that support this option are: sonarqube, xunit, json, doc, markdown.

--prependTestFileName (-p)

This option is only available for the sonarqube report type. This adds a string to the front of the generated file name in the report useful if you run tests from within a subdirectory.

tap test/\*.js | tap-reporter sonarqube --output tests-execution.xml --prependTestFileName "src/app/tests"