Fix #1191

Make sure that a test case returning a promise fails if the promise is rejected without a reason.