Skip to content
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

emit retry so we know when tests are using this feature #2950

Closed
fpereira1 opened this issue Aug 10, 2017 · 2 comments
Closed

emit retry so we know when tests are using this feature #2950

fpereira1 opened this issue Aug 10, 2017 · 2 comments

Comments

@fpereira1
Copy link

Hi,

I would like to know which of my tests are being retried but, with existing mocha this is not possible.

I was thinking to emit 'test retry' on the block below and then, the reporters could display this.

mocha/lib/runner.js

Lines 556 to 563 in 075bd51

} else if (retry < test.retries()) {
var clonedTest = test.clone();
clonedTest.currentRetry(retry + 1);
tests.unshift(clonedTest);
// Early return + hook trigger so that it doesn't
// increment the count wrong
return self.hookUp('afterEach', next);

Would it be possible to add this, or is there another way that this can be achieved?

Thanks!

@ScottFreeCode
Copy link
Contributor

This has actually been discussed in #2529 (although it's not as clear if it's what that issue was about from the start), and an implementation submitted in #2926. #2901 also adds information to the test object that would, presumably make it possible to view the retried failures at the point when the test ends and the existing events are emitted, but does not allow these errors to be seen at the time when they actually occur (see #2529 (comment) for more detail).

/cc @mochajs/core Let's not forget to review those at some point.

@fpereira1
Copy link
Author

@ScottFreeCode perfect thank you. Closing this for the issue #2529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants