-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test results skipped when using mocha's retries api #125
Comments
This is due to the way mocha handles retries. When mocha retries a test, it clones the test and adds it to the array of tests to be run. It doesn't mark the retried test in any special way or emit an event for retries so there is nothing for the reporter to hook into to know that the test was retried. Further, Mochawesome generates its report based on the suite object emitted in the There is some more discussion around this here: mochajs/mocha#2188 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi, I tried anothers reports like "mocha-simple-html-reporter" and this last one is able to display retried test in error. Here is the test: describe( 'Test retries', function () { And here is the resulting report from 'mocha-simple-html-reporter'. I hope this post can help to perform your very awesome mocha report 👍 |
Looked into this again but I'm still not sure there's an easy solve. Problem is that retries are kind of a hack. They are clones of the original tests. They don't relate back to the original in any way and are not added to the parent suite's list of tests. When a retry test passes or fails, the stats object is modified, however the original test is not updated to reflect the status and does not count toward the stats. |
The Mocha |
@adamgruber - while using
and the json results
|
This no longer appears to be an issue starting with mocha 7.1.0 |
Hi Adam,
I have a problem when using mocha
retries
api.Here's a spec file:
And my test script is:
The result in console is correct:
However, the generated html report shows a quite different result:

Why these two test cases using
retries
be skipped?The text was updated successfully, but these errors were encountered: