-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Jest snapshot testing fails for <img /> tag. #4991
Comments
This is not a proper bug report that allows us to reproduce your behavior. |
Hi @cpojer sorry my keyboard tabbed to the submit button and I submitted too early. I've edited and provided all details. Can you please re-open? Thanks! |
It doesn't reproduce for me like that. Can you share a full example on repl.it that shows the breaking test? Thank you. |
I also updated the react component code above to show how I'm requiring the image. Can you try with an SVG? I'll also try to create something on repl.it today. |
Same error as #4922, can you reproduce on latest jest beta? |
Ah nice catch @SimenB . I tried that and the error changes to:
Also, FYI I'm using ts-jest. |
Huh, that means What does |
Here's what
|
Oh dear, What happens if you're explicit about A new beta (not released yet) plus kulshekhar/ts-jest#380 might solve your issue |
@SimenB what do you mean by being explicit? Thanks for making a push to ts-jest! |
Having |
Hmm, unfortunately still getting that error :(.
Do you know what's actually happening here? |
|
Ah I see. Ok will wait for that then. |
Is it resolved? I use [email protected] in my project and I still getting this error |
Should be resolved, yes. If you're still having issues, please provide a reproduction |
@PainKKKiller / @ashok-sc I was able to fix it changing this line in the
To:
And this is the content of // __mocks__/fileMock.js
module.exports = 'test-file-stub' It seems that |
Thank you for the support. This had saved few nights!! |
@daviscabral Saved my life!! |
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. |
Reporting a BUG
What is the current behavior?
When running my test I get the following error:
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.This is the component I'm testing.
Here's my test:
What is the expected behavior?
Create a snapshot and pass test.
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
Jest config:
The text was updated successfully, but these errors were encountered: