acuminous / yadda

A BDD javascript library
412 stars 73 forks source link

Error in a promise step is not reported to QUnit, test hangs #235

Closed lolmaus closed 6 years ago

lolmaus commented 6 years ago

Consider this step:

.then("should not crash", async function () {
  throw new Error("Oops, it crashed");
})

(Note: this function returns a rejected promise.)

For me, this code results in QUnit hanging and timing out. The error is visible in console as "uncaught error in promise", but not in QUnit output.

I tried to follow Yadda codebase from here and got lost in callbacks.

To resolve the issue, a rejected promise must be handled as a failed assertion.

PS I :heart: promises and I do want to write my steps like shown above.

lolmaus commented 6 years ago

May be an issue downstream: https://github.com/albertjan/ember-cli-yadda/issues/62

lolmaus commented 6 years ago

It is an issue downstream.