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

🚀 Feature: Fail tests/suites that does not exit gracefully when --no-exit flag is used #1855

Open
TheLudd opened this issue Sep 2, 2015 · 5 comments
Labels
status: accepting prs Mocha can use your help with this one! type: feature enhancement proposal

Comments

@TheLudd
Copy link

TheLudd commented Sep 2, 2015

I recently tried the --no-exit flag and found it a terrific way to determine if any of my modules keep active listeners. However, if it is the case that I have open listeners then mocha never exits. Would it be possible to add a timeout just as in asynchronous tests for this. Meaning that if I use the --no-exits flag and the event loop is not clear after my suite is complete, then make the test fail.

I'd be happy to supply this as a PR if the idea is accepted.

@boneskull
Copy link
Contributor

Sounds reasonable to me

@danielstjules
Copy link
Contributor

How would you imagine supplying the timeout for --no-exit?

@TheLudd
Copy link
Author

TheLudd commented Sep 10, 2015

I havent thought about that detail. Would it be possible to use the standard 2000ms and have it changed by globally overriding with --timeout?

@stale
Copy link

stale bot commented Oct 17, 2017

I am a bot that watches issues for inactivity.
This issue hasn't had any recent activity, and I'm labeling it stale. In 14 days, if there are no further comments or activity, I will close this issue.
Thanks for contributing to Mocha!

@stale stale bot added the stale this has been inactive for a while... label Oct 17, 2017
@ScottFreeCode
Copy link
Contributor

This issue only seems more relevant now that we've walked people through debugging their --no-exit hangs now that Mocha --no-exits by default.

@stale stale bot removed the stale this has been inactive for a while... label Oct 17, 2017
@boneskull boneskull added type: feature enhancement proposal and removed status: waiting for author waiting on response from OP - more information needed labels Oct 17, 2017
@JoshuaKGoldberg JoshuaKGoldberg changed the title Fail tests/suites that does not exit gracefully when --no-exit flag is used 🚀 Feature: Fail tests/suites that does not exit gracefully when --no-exit flag is used Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Mocha can use your help with this one! type: feature enhancement proposal
Projects
None yet
Development

No branches or pull requests

5 participants