-
Notifications
You must be signed in to change notification settings - Fork 8
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
Node 10 runtime seems to have a default unhandledRejection listener #7
Conversation
are you able to run the tests under node 10? I ran into issues when I tried to set this up myself (I used a similar solution to your second commit) with rewire under node 10. It seems there is an issue with rewiring globals after node 9. This is likely going to require switching to another mocking utility. |
I tried the logger in my project with my changes in the SAM local Node 10 runtime and that worked. I just now tried running the tests in Node 10.17.0 and it looks like they just die without much of an error message. I'm not that familiar with the libraries you've used so it'll take some time to track down what's going wrong. Maybe the following will be helpful. I don't think I'll have time to fix it today if it requires switching to a different mocking solution.
|
Dying without error is caused by a leak in the console mock overriding the global console log, swallowing all the test reporting. I am working on this |
closing in favor of #8 |
Fixes #6
In the Node 8 runtime there is no
unhandledRejection
listener, so the strictEqual to 0 passes. In the Node 10 runtime it appears there is oneunhandledRejection
listener which breaks the assertion.This change allows 0 or 1 listeners and removes any listeners that are there, which matches the
uncaughtException
behavior. It appears to work in SAM local but I wouldn't say I have tested it thoroughly yet.