Reputation: 3887
I have node.js project and I'd like to run test cases written mocha (visionmedia.github.io/mocha/) in our bamboo (atlassian product), but mocha does not provide any reported for bamboo, ie. JUnit reporter.
I'm thinking about coverting xUnit to JUnit formart, but so far I've not found any solution for this.
Can any one advice?
Upvotes: 0
Views: 2072
Reputation: 2981
use https://www.npmjs.com/package/mocha-bamboo-reporter there is a task "Mocha Test Parser" which is installed when you install the nodejs bamboo plugin.
Pickup the results written from the mocha-bamboo-reporter with this task in "final tasks" of your build stage
Upvotes: 0
Reputation: 3887
so far I fixed this by subunit combo:
mocha -R tap ./test/*.js > ./test-reports/result.tap
cd ./test-reports
cat ./result.tap | \
tap2subunit | subunit2junitxml > result.junit && \
xmllint --pretty 1 result.junit > result.junit.xml
Upvotes: 1