danielstjules / mocha.parallel

Run async mocha specs in parallel
MIT License
197 stars 20 forks source link

Support for mocha retries from mocha config #53

Open rakeshpareek01 opened 1 year ago

rakeshpareek01 commented 1 year ago

module.exports = { 'allow-uncaught': false, 'async-only': false, bail: false, 'check-leaks': false, color: true, delay: false, diff: true,

retries: 2, };

Good to have support for failed test retries

steph-lebl commented 1 year ago

I agree with @rakeshpareek01! We are using mocha.parallel for concurrent api testing and having the possibility to retry will help dealing with flaky tests in the build process.

steph-lebl commented 1 year ago

Hi @rakeshpareek01!

Here is the PR for adding retries to mocha.parallel: https://github.com/danielstjules/mocha.parallel/pull/54

If your interested in the concurrent api testing, the tooling that supports the approach already includes mocha.parallel retries. When a test does not does not succeed on the first time (flaky), the full error in JSON format is available in the test report. Ex: https://github.com/VilledeMontreal/mocha-concurrent-api-tests/blob/master/example/README.md#test-report-exemple-when-a-test-fails-or-does-not-succeed-on-the-first-time-flaky

Please give a star to https://github.com/VilledeMontreal/mocha-concurrent-api-tests if it helps you!

Have a nice day!