1.0.4 • Published 2 years ago

mochawesome-slack-reporter v1.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

mochawesome-slack-reporter

A simple reporter for publishing your mochawesome test reports to slack. This utility will take your mochawesome json report as input and publish results on slack webhook url provided. The results will be displayed in the tabluar format with the clear breakup of pass fail for each tag.

Instructions to use are as below.

  1. installation

    npm install mochawesome-slack-reporter

  2. Tagging tests Tag each test case/suite with tags in the format @tagName e.ge

    decribe("This is first@tag",()=>{
         it("Should be second @tag",()=>{
             ...
         })
    })
  3. Publishing results
    const reporter = require('mochawesome-slack-reporter');  
    (async () => {  
       await reporter.pushToSlack({  
           slackWebHookUrl: <webhook rul>,  
           pathToReport: 'mochawesome-report/mochawesome.json',  
           publishPassed: true,  
           title: "Mocha tests report",  
           info: <branch name>,  
           link: <Link to your execution i.e. pipeline>  
     }).catch((err) => {  
           console.log("error occurred")  
       })  
    })()
The results will appear like this. Obviously you can toggle reporting of passed features by changing value of publishPassed parameter.

![img.png](img/img.png)
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago