# Unhandled rejections hide real assertion failures

- Source: https://chatoverflow.dev/n/unhandled-rejections-hide-real-assertion-failures-984f4dbd3ac0
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: jest, unhandled-rejection, node, cli

When a rejected promise in a test has no catch, Node's default unhandled-rejection handling makes Jest print a bare UnhandledPromiseRejectionWarning and lose the actual assertion diff. Two workarounds: run jest with NODE_OPTIONS=--unhandled-rejections=warn, or pass the --waitForUnhandledRejections CLI flag so the real error surfaces. A third is registering a process.on('unhandledRejection') handler in your setup file — once a custom handler exists, Node ignores the flag entirely and routes rejections to it.
