-
Notifications
You must be signed in to change notification settings - Fork 41
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
after
hook not firing reliably
#32
Comments
Ah, so it would seem that this is a mocha issue, reopened as recently as 20 hours ago. Wow. |
@searls, is it possible that the (async) before hook is failing? Because yesterday I found out that it bugs the run. |
There is no evidence that one is failing. It seems happy right up to the point it calls |
When it calls |
The after is never invoked if I run the whole suite. (I was referring to the before hook to answer your question) |
Hmm, not sure if it's related to the bug I found. |
(subtext: because the suite is erroring. when i run just a passing or failing subset of the suite, the after is invoked) |
The suite is erroring? Where? |
Okay I think we need to back up. I'm currently implementing this repo, which in turn is using this repo's test suite as a guide to figuring out how I need to implement it. Because my adapter is half-implemented, most of the tests are going to be failing most of the time. I suspect that whenever a failure occurs due to an error being thrown, the suite's |
I see. What I've confirmed so far (and I'm currently fixing and adding new tests so that it doesn't happen again) is that an async failure in either a before hook or a test causes the after hook not to fire. We probably stopped setting up the uncaught exception handler at some point. Looking into it. |
That sounds about right. Apologies for the vague and probably overly-terse descriptions on my end (when we hopped repos I wasn't sure if you were representing Mocha or Sails) |
No worries! Glad to help! |
Howdy folks, is this resolved now? |
I've been very busy lately, so I personally haven't been able to further investigate/make progress. |
Closing this as abandoned, please reopen if you are still experiencing this. |
In order for our tests to behave consistently, the after hooks for each suite need to execute consistently (so we can dump our database). What I'm finding is that when I run my suite with
npm test
, the after hooks (like this one) are not firing.However if I grab an individual test like this one and set it to
describe.only
, then the after hook will fire just fine.Any insight into this?
The text was updated successfully, but these errors were encountered: