You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a failing unit test due to an unhandled promise rejection. I think it might have slipped by if you've only run the unit tests with an earlier version of node that just provides a warning in this situation.
Steps to reproduce:
Use NodeJS v16+
Run unit tests via yarn test.unit
Result:
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason
"TypeError: Cannot read property 'headers' of null".] {
code: 'ERR_UNHANDLED_REJECTION'
}
FAIL src/bootloader-shared.unit.ts
● Test suite failed to run
Jest worker encountered 4 child process exceptions, exceeding retry limit
at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)
The error appears to originate in the setUpWebWorker() function in src/bootloader-shared.ts. Specifically, this statement:
This project is exciting! Keep the momentum.
I ran into a failing unit test due to an unhandled promise rejection. I think it might have slipped by if you've only run the unit tests with an earlier version of node that just provides a warning in this situation.
Steps to reproduce:
yarn test.unit
The error appears to originate in the
setUpWebWorker()
function insrc/bootloader-shared.ts
. Specifically, this statement:We're expecting
fetch(url)
to return a response with aheaders
key. The mock for fetch in the unit test, however, returnsnull
:I tried changing the mock to provide the minimal response object to avoid an error, and it appears to resolve the issue:
Is this the correct way to resolve the issue? If so, I could submit a pull request.
I appreciate any insight you can provide as well. Thanks!
The text was updated successfully, but these errors were encountered: