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

Fix runGlobalHook error when message is unwritable #14113

Conversation

david-szabo97
Copy link
Contributor

Summary

Fixes #14112

Test plan

Use the development build to run the tests in the repository mentioned in the issue.

Before the PR:

$ node ../jest/packages/jest-cli/bin/jest.js
TypeError: Cannot set property message of Error which has only a getter
    at runGlobalHook (jest-message-getter-issue\node_modules\@jest\core\build\runGlobalHook.js:114:25)
    at async runJest (jest-message-getter-issue\node_modules\@jest\core\build\runJest.js:327:5)
    at async _run10000 (jest-message-getter-issue\node_modules\@jest\core\build\cli\index.js:344:7)
    at async runCLI (jest-message-getter-issue\node_modules\@jest\core\build\cli\index.js:199:3)
    at async Object.run (jest-message-getter-issue\node_modules\jest-cli\build\run.js:124:37)

With the PR:

$ node ../jest/packages/jest-cli/bin/jest.js
Error: Jest: Got error running globalSetup - D:\Repos\Github\jest-message-getter-issue\setup.js, reason: [ErrorMessageGetter: Error message is: We will never see this message :( (setup)]
    at runGlobalHook (jest\packages\jest-core\build\runGlobalHook.js:124:15)
    at async runJest (jest\packages\jest-core\build\runJest.js:327:5)
    at async _run10000 (jest\packages\jest-core\build\cli\index.js:344:7)
    at async runCLI (jest\packages\jest-core\build\cli\index.js:199:3)
    at async Object.run (jest\packages\jest-cli\build\run.js:124:37)

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 28, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: david-szabo97 / name: Dávid Szabó (fe4ac69, 0ec6646)
  • ✅ login: SimenB / name: Simen Bekkhus (36ecbeb)

@netlify
Copy link

netlify bot commented Apr 28, 2023

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 36ecbeb
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/64c234abc029680008fd4b54
😎 Deploy Preview https://deploy-preview-14113--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jul 27, 2023
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@SimenB SimenB merged commit e7d991c into jestjs:main Jul 27, 2023
9 of 10 checks passed
@SimenB
Copy link
Member

SimenB commented Jul 27, 2023

@github-actions
Copy link

This pull request 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 Aug 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Global setup and teardown throws an error when the message property is unwritable
2 participants