question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multiple reporters in browser

See original GitHub issue

Is your feature request related to a problem or a nice-to-have?? This is a ‘nice-to-have’

I think it’s awesome that mocha supports running in the browser!

I would like mocha be able to support multiple reporters for the browser - mainly for using ‘json-stream’ with ‘html’. Currently you can only specify one reporter.

Describe the solution you’d like

My first thought would be to have mocha.setup() be able to accept an array reporters instead of just a single string For example:

    mocha.setup({
        ui: 'bdd',
        reporter: ['html', 'json-stream']
    });

Another solution would be to have json-stream as an additional option:

    mocha.setup({
        ui: 'bdd',
        reporter: 'html',
        jsonStream: true,
    });

As a side note I have a one-line hack working in ‘mocha.js’ so I know it’s definitely possible

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

1reaction
janiukjfcommented, Jun 12, 2019

I would love the former option, especially for dealing with code coverage, nyc, and artifact output. I want my CI runs to show the results as they are running but also output to an xml file. I’ve tried other hacky npm packages, like mocha-multi, with mixed results and it would be nice if this was first party.

0reactions
letsgotomarscommented, Jan 29, 2020

Also I made another one-liner change here:

    Progress.prototype.update = function(n) {
      // ===== < CUSTOM MOD > =====
      // Provide hook into mocha testing progress
      window.mocha.percentComplete = n;
      // ===== </ CUSTOM MOD > =====
      this.percent = n;
      return this;
    };
Read more comments on GitHub >

github_iconTop Results From Across the Web

Use multiple reporters in Mocha browser? - Stack Overflow
Is it possible to use multiple reporters in the browser version of Mocha? I'm creating a reporter that sends test results to my...
Read more >
Adding Multiple reporters to a request - Atlassian Community
Solved: Is there a way i could enable multiple reporters to an issue type? This should ideally show up under people section of...
Read more >
testcafe-reporter-multiple-html - npm
This TestCafé reporter generates an HTML report with default support for stackTrace, screenshots sorting and searching. Layout inspired by the ...
Read more >
Reporters | Intermediate Guides | Guides | Docs - TestCafe
Reporters · Included Reporters · Community Reporters and Custom Reporters · Install New Reporters · Specify the Reporter · Output data to disk...
Read more >
GitHub - wswebcreation/multiple-cucumber-html-reporter
a features overview that can hold multiple runs of the same feature / runs of the same feature on different browsers / devices;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found