2.1.1 • Published 4 years ago

@prnsml/mocha-junit-reporter v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

JUnit Reporter for Mocha

This is fork of https://github.com/michaelleeallen/mocha-junit-reporter for those who want to use jenkinsClassnamePrefix option.

Installation

$ npm install @prnsml/mocha-junit-reporter@2.1.1 --save-dev

or as a global module

$ npm install -g @prnsml/mocha-junit-reporter@2.1.1

Full configuration options

ParameterDefaultEffect
mochaFiletest-results.xmlconfigures the file to write reports to
includePendingfalseif set to a truthy value pending tests will be included in the report
propertiesnulla hash of additional properties to add to each test suite
toConsolefalseif set to a truthy value the produced XML will be logged to the console
useFullSuiteTitlefalseif set to a truthy value nested suites' titles will show the suite lineage
suiteTitleSeparatedBy (space)the character to use to separate nested suite titles. (defaults to ' ', '.' if in jenkins mode)
testCaseSwitchClassnameAndNamefalseset to a truthy value to switch name and classname values
rootSuiteTitleRoot Suitethe name for the root suite. (defaults to 'Root Suite')
testsuitesTitleMocha Teststhe name for the testsuites tag (defaults to 'Mocha Tests')
outputsfalseif set to truthy value will include console output and console error output
attachmentsfalseif set to truthy value will attach files to report in JUnit Attachments Plugin format (after console outputs, if any)
antModefalseset to truthy value to return xml compatible with Ant JUnit schema
antHostnameprocess.env.HOSTNAMEhostname to use when running in antMode will default to environment HOSTNAME
jenkinsModefalseif set to truthy value will return xml that will display nice results in Jenkins
jenkinsClassnamePrefixundefinedadds a prefix to a classname when running in jenkinsMode