Log unhandled promise rejections in testing #9376

Added a log of the error stack.

Are tests typically written for log statements? I attempted to add a test but struggled; I would need some guidance to set up the scenario in which this log statement appears.