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

[Bug]: [jest-runtime] - TypeError: Cannot read property 'bind' of undefined with introduction of jest.replaceProperty #13822

Closed
ahnpnl opened this issue Jan 26, 2023 · 4 comments · Fixed by #13823

Comments

@ahnpnl
Copy link
Contributor

ahnpnl commented Jan 26, 2023

Version

29.4.0

Steps to reproduce

Expected behavior

Should pass the tests. 29.3.1 doesn't have this problem.

Actual behavior

See error log of CI https://github.com/thymikee/jest-preset-angular/actions/runs/4013381682/jobs/6892664896

Additional context

The error log pointed to at Runtime._createJestObjectFor (../../node_modules/jest-runtime/build/index.js:2099:64) which is this line https://github.com/facebook/jest/blob/be021fa8b722f1d367833e8f48bbb08e6e3dd687/packages/jest-runtime/src/index.ts#L2322

Environment

System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 16.19.0 - /opt/homebrew/bin/node
    Yarn: 3.2.3 - /opt/homebrew/bin/yarn
    npm: 8.19.3 - /opt/homebrew/bin/npm
  npmPackages:
    jest: ^29.4.0 => 29.4.0
@ahnpnl ahnpnl changed the title [Bug]: [jest-runtime] - TypeError: Cannot read property 'bind' of undefined with introduction of jest. replaceProperty [Bug]: [jest-runtime] - TypeError: Cannot read property 'bind' of undefined with introduction of jest.replaceProperty Jan 26, 2023
@SimenB
Copy link
Member

SimenB commented Jan 26, 2023

The issue on your side is that you use jest-environment-jsdom@28 in your tests.

However, we should handle that missing on our side.

@ahnpnl
Copy link
Contributor Author

ahnpnl commented Jan 26, 2023

Thanks for the information!

@SimenB
Copy link
Member

SimenB commented Jan 26, 2023

https://github.com/facebook/jest/releases/tag/v29.4.1

@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 Feb 26, 2023
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.

2 participants