tap-xunit-circleci
v1.0.0
Published
TAP to xUnit XML converter. Forked from Ali Ghassemi's tap-xunit to better work with CI environments
Downloads
594
Maintainers
Readme
tap-xunit
NOTE: This is a fork of https://github.com/aghassemi/tap-xunit. It does exactly the same thing except for:
- All TAP output is outputted via stderr so that you can still see TAP messages when running this in a CI environments
- You get timing data per test file
It otherwise functions the same. You cannot install this AND aghassemi's version at the same time since the command namespace is identical
Converts TAP to xUnit XML format.
TAP output from testing frameworks such as tape or node-tap can be piped directly to tap-xunit
node test.js | tap-xunit
Installation
npm install tap-xunit -g
Usage
CLI
node test.js | tap-xunit
less results.tap | tap-xunit --package="MyCompany.MyTool" > results.xml
By default TAP comments are used as test-suite names and considered to mark test boundaries. CLI flag --dontUseCommentsAsTestNames
can be used to turn that feature off, in which case comments are ignored and
all assertions go inside a single <testsuite name="Default">
with name Default
Library
var converter = require('tap-xunit');
// Optional configuration
var opts = {}
var tapToxUnitConverter = converter(opts);
tapInputStream.pipe(tapToxUnitConverter).pipe(xUnitOutStream);
Options
Options can be passed as CLI arguments by being prefixed with --
dontUseCommentsAsTestNames
default: false
By default TAP comments are used as test-suite names and considered to mark test boundaries.
This option can be used to turn that feature off, in which case comments are ignored and
all assertions go inside a single <testsuite name="Default">
with name Default
replaceWithUnicodeDot
default: false
Whether the '.' in test-suite names should be replaced with a Unicode homoglyph. This feature exists because many xUnit reporters assume '.' in test-suite name implies package hierarchy, which may not be the case.
package
default: ''
If specified, all test-suites will be prefixed with the given package name.
NOTE: replaceWithUnicodeDot
option does not apply to package and . can be used to specify package hierarchy.
License
MIT