Skip to content

This module provides detailed mocha test run report to the slack communication channel.

Notifications You must be signed in to change notification settings

medaamarnadh/mocha-ci-reporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mocha-ci-reporter

Table of contents

Introduction

This is a Node.js module that gives detailed report about your tests excution on any CI server such as Jenkins, CircleCI etc.

Features

  • 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

How to use

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))
})
`

The example output for the slack report looks like below.  The image is not supporting

About

This module provides detailed mocha test run report to the slack communication channel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published