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 and babel-jest 27.3.0v update gives error on running tests #11955

Closed
eshanCV opened this issue Oct 13, 2021 · 7 comments · Fixed by #11998
Closed

[Bug]: Jest and babel-jest 27.3.0v update gives error on running tests #11955

eshanCV opened this issue Oct 13, 2021 · 7 comments · Fixed by #11998

Comments

@eshanCV
Copy link

eshanCV commented Oct 13, 2021

Version

27.3.0

Steps to reproduce

Updated the jest and babel-jest versions to 27.3.0v and gives below error,

image

Expected behavior

Should be able to run my existing tests without any error

Actual behavior

Gives above mentioned error

Additional context

No response

Environment

System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Binaries:
    Node: 16.2.0 - C:\Program Files\nodejs\node.EXE        
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 7.13.0 - C:\Program Files\nodejs\npm.CMD
npmPackages:
    jest: ^27.3.0 => 27.3.0
@SimenB
Copy link
Member

SimenB commented Oct 13, 2021

Please provide a reproduction

@eshanCV
Copy link
Author

eshanCV commented Oct 20, 2021

Please provide a reproduction

Hi @SimenB,

Please find the reproduction URL

@mrazauskas
Copy link
Contributor

@eshanCV The identity-obj-proxy library is not a Jest transformer. That’s why you get that error.

Remove identity-obj-proxy from the transform object in Jest config and all will work as expected.

@eshanCV eshanCV changed the title [Bug]: Jest and babel-jest 27.2.5 update gives error on running tests [Bug]: Jest and babel-jest 27.3.0v update gives error on running tests Oct 29, 2021
@eshanCV
Copy link
Author

eshanCV commented Oct 29, 2021

@eshanCV The identity-obj-proxy library is not a Jest transformer. That’s why you get that error.

Remove identity-obj-proxy from the transform object in Jest config and all will work as expected.

Hi @mrazauskas,

Thanks for the reply, But after removing it, gives below error,

image

@mrazauskas
Copy link
Contributor

@eshanCV Do not remove the identity-obj-proxy module. Just delete it from transform object in your Jest config. Follow this guide from Jest docs – https://jestjs.io/docs/webpack#mocking-css-modules

This is not a bug.

@eshanCV
Copy link
Author

eshanCV commented Nov 2, 2021

@mrazauskas Thanks, removing identity-obj-proxy and adding testEnvironment worked for me

image

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

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 Dec 3, 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.

3 participants