karma-jenkins-reporter
Reporter for the JUnit XML format for Jenkins.
This is a fork of karma-junit-reporter.
Installation
The easiest way is to keep karma-jenkins-reporter
as a devDependency in your package.json
.
You can simple do it by:
npm install karma-jenkins-reporter --save-dev
Configuration
// karma.conf.jsmodule { config;};
You can pass list of reporters as a CLI argument too:
karma start --reporters jenkins,dots
Divergence from original project
options
options.classnameSuffix
will be appended the classname
property
The output xml file will can also be set via an environment variable:
REPORT_FILE its directory name is also used as the classname
property in the xml file, replaced /
by a dot.
You can also set a base path for the files via PREFIX.
Furthermore there is is passed through the MAKE_TARGET environment varibale as a make_target
property into each testsuite.
result
classname
property of a testcase have no pacakge and browser information anymore, instead the contain the directory of REPORT_FILE, dot seperated- package and browser information in a testcase is written into the
package
property make_target
of a testsuite is passed by env variable MAKE_TARGET- if you use nested testsuites (for instance nested
describe
functions in mocha), the hierarchy is mapped to a flat array, joind with|
into theparentSuites
property of each testcase
example xml
if you have this mocha testsuite
;
the result will look like this xml
<![CDATA[]]>
For more information on Karma see the homepage.