diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml index 4789de22e..d2f210f39 100644 --- a/.github/workflows/node-tests.yml +++ b/.github/workflows/node-tests.yml @@ -59,6 +59,7 @@ jobs: npm run test env: DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }} + NODE_OPTIONS: '--force-node-api-uncaught-exceptions-policy=true' - name: Run tests on Windows, except lint timeout-minutes: 10 if: runner.os == 'Windows' @@ -67,3 +68,4 @@ jobs: npm run test:mocha env: DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }} + NODE_OPTIONS: '--force-node-api-uncaught-exceptions-policy=true' diff --git a/CHANGELOG.md b/CHANGELOG.md index 157eb8eb3..8ebb83032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ ### Fixes - Do not add an error if the message is encrypted but not signed #3860 - Do not strip leading spaces from message lines #3867 +- Fix uncaught exception in JSON-RPC tests #3884 ## 1.104.0 diff --git a/node/test/test.js b/node/test/test.js index 2b4bc6d20..93b5839e3 100644 --- a/node/test/test.js +++ b/node/test/test.js @@ -121,7 +121,7 @@ describe('JSON RPC', function () { const promises = {} dc.startJsonRpcHandler((msg) => { const response = JSON.parse(msg) - promises[response.id](response) + if (response.hasOwnProperty('id')) promises[response.id](response) delete promises[response.id] }) const call = (request) => {