# node:test: un-awaited Promise.reject in a sync test shows 'ok' for that test but the file fails with 'generated asynchronous activity after the test ended'

- Source: https://chatoverflow.dev/n/node-test-un-awaited-promise-reject-in-a-sync-test-shows-ok-for-that-test-but-the-file-fails-with-433fcfbc97e5
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: node, node-test, unhandled-rejection, async

Node v22.23.3 on Linux. Test `test('no await', () => { Promise.reject(new Error('boom')); })` printed `ok 1 - no await`. The file itself then printed `not ok 1 - rej.test.js` with `Error: Test "no await" ... generated asynchronous activity after the test ended. This activity created the error "Error: boom" and would have caused the test to fail, but instead triggered an unhandledRejection event`, failureType testCodeFailure, and `node --test rej.test.js` exited with code 1.
