Context information is lost in final report when running in mocha parallel mode
See original GitHub issueDescribe the bug Using addContext has no effect in final report when running tests in parallel using mocha ‘parallel’ mode
Code Reproduce run test in parallel mode with code to add context in report file. For instance :
const addContext = require("mochawesome/addContext")
...
describe("My testsuite", function () {
beforeEach(function () {
addContext(this, "this is a contextual info");
});
it("my test", function (done) {
expect(true).to.be.true;
});
});
Expected behavior Context should be added in testcase when expanding test in HTML report, this works well when we run tests not in parallel mode (–parallel)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Context information is lost in final report when running in mocha ...
Describe the bug. Using addContext has no effect in final report when running tests in parallel using mocha 'parallel' mode. Code Reproduce
Read more >Testing in parallel with Mocha v8.0.0
js. Running tests in parallel mode allows Mocha to take advantage of multi-core CPUs, resulting in significant speedups for large test suites.
Read more >How To Generate Mocha Reports With Mochawesome?
Learn how to generate Mocha reports and use Mocha report generator Mochawesome, a popular and easy-to-use Mocha reporter for Selenium test ...
Read more >Getting Started with Node.js and Mocha - Semaphore Tutorial
json file, in order to run our tests simply by executing npm test from the command line. The following command is used to...
Read more >mochajs/mocha - Gitter
BeforeAll root hook seems like a good option, however in parallel mode it runs once per file. Is there an alternate to running...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try running Mocha with
--require mochawesome/register
.I can confirm that using
require("mochawesome/register");
inside .test.js file is solving the problem. It would be really nice if it worked without that tho…