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
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.