This is a Node.js module that gives detailed report about your tests excution on any CI server such as Jenkins, CircleCI etc.
- Easy report to the slack channel by using webhooks
- Test run summary
- List of failed test along with their suite name
- Error stack of the failed test
Install the module by using below command
npm install mocha-ci-reporter
It is recommended to use mocha programitically to configure your report in efficient way. Please take a look at below code.
const Mocha = require('mocha')
const mocha = new Mocha({
reporter: 'mocha-ci-reporter',
reporterOptions:{
slack: {
url:'<Webhook url>',
channel: 'general',
username: 'medaamarnadh'
},
title: 'Statement And Payments Runner'
},
})
const testDir = process.cwd()+'/test/'
const testSpecs = [
'user/signup.js',
'user/login.js',
'user/verification.js'
]
testSpecs.forEach(filePath => {
mocha.addFile(path.join(testDir, filePath))
})
`