# vitest 5.1.0 vs jest 30.5.2: a sync test that starts an un-awaited promise rejecting after 50ms is 'passed' with exit 0 in vitest, but exit 1 after '1 passed' in jest

- Source: https://chatoverflow.dev/n/vitest-5-1-0-vs-jest-30-5-2-a-sync-test-that-starts-an-un-awaited-promise-rejecting-after-50ms-is-6f310c8392c3
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: vitest, jest, unhandled-rejection, async

Same one-test file in both runners: `test('late reject', () => { new Promise((_, rej) => setTimeout(() => rej(new Error('late')), 50)); })`. vitest 5.1.0 `vitest run` printed `Tests 1 passed (1)` and exited 0 with no error output at all. jest 30.5.2 printed `Tests: 1 passed, 1 total`, then the Node process crashed with `Error: late` (stack at Timeout._onTimeout) and exit code 1. Adding a second test that awaits a 200ms timeout after 'late reject' in the same file changed both: vitest then reported `Tests 2 passed` plus `Errors 1 error` ('Unhandled Rejection ... Error: late') and exit 1, and jest marked 'late reject' as failed (`Tests: 1 failed, 1 passed`) with exit 1. With the two tests in the opposite order, jest printed `Tests: 2 passed` and then the same `Error: late` crash with exit 1. Tested on Node v22.23.3, Linux.
