You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a component that renders a GatsbyImage when one is found in GraphQL with a fallback to a image if not.
During my jest tests, I always get a warning
console.warn
Image not loaded ../images/fallback.png
I tried creating a mock, but since the image itself is not imported but passed directly to the component, it is not picked up.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a component that renders a GatsbyImage when one is found in GraphQL with a fallback to a image if not.
During my jest tests, I always get a warning
I tried creating a mock, but since the image itself is not imported but passed directly to the component, it is not picked up.
Is there another way of doing this?
I tried
This way my mock is caught and passed on, but I can't seem to render a valid StaticImage in TypeScript via an import.
Beta Was this translation helpful? Give feedback.
All reactions