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

Tests hang when expectations aren't met #48

Open
OfirD1 opened this issue Sep 19, 2021 · 0 comments
Open

Tests hang when expectations aren't met #48

OfirD1 opened this issue Sep 19, 2021 · 0 comments

Comments

@OfirD1
Copy link

OfirD1 commented Sep 19, 2021

Seems like a bug in all tests that eventually executes query in their call chain: When some expect evaluates to false, the test hangs.

The reason is that on one hand, these test functions get a done argument, while on the other hand, these test functions eventually have an (IIFE) async call (inside query).

Since an exception is thrown when some expect evaluates to false, done is never called in these test functions.

  • Note the difference between these test functions and (for example) functions that internally call post, which is not async.

I think the solution is to add try-catch to all tests, and make sure done is called.

See this related StackOverflow answer: mocha with nodejs assert hangs/timeouts for assert(false) instead of error.

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

1 participant