redux-observable: Uncaught errors from promises getting swallowed when running in Jest

Example:

const ohNoEpic = action$ => action$
  .ofType('OH_NO') // where OH_NO is some real action type that will be matched
  .mergeMap(() =>
    Observable.fromPromise(new Promise(() => { throw Error('oh no') }))
  )

In the browser this yields a stack trace on the console… in Jest, nothing happens. If the promise was a real epic that was being tested, the test would eventually time out, with no useful error message being printed.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 29 (29 by maintainers)

Most upvoted comments

Yep, I just discovered I could reproduce in the browser too 😃

Cool, thanks for the pointer, I might try against that patch.