Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stack' of undefined #11002

Closed
just-boris opened this issue Jan 8, 2021 · 1 comment · Fixed by #11003
Closed

Comments

@just-boris
Copy link
Contributor

🐛 Bug Report

When globalSetup function returns an undefined rejected promise, Jest exits with zero exit code and unhandled rejection warning:

(node:23880) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stack' of undefined
    at Object.run (/path/to/project/node_modules/jest/node_modules/jest-cli/build/cli/index.js:169:15)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

To Reproduce

Create a global setup with the following content

module.exports => Promise.reject()

Expected behavior

Jest handles the rejection and exits with non-zero code.

This also worked as expected in Jest 25, so it seems to be a regression

envinfo

  System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 12.20.0 - ~/n/bin/node
    npm: 6.14.8 - ~/n/bin/npm
  npmPackages:
    jest: ^26.6.3 => 26.6.3
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant