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
What I usually do is just transform the SVG into an empty module (in this case it needs to be something react-y I assume since svg-react-loader transforms SVG's into Components.
What is a good generic way to transform SVG's like that? Is stubbing them out to be nothing too limiting for some people who want to assert on the SVG?
Happy to create a PR if we can clear this up!
The text was updated successfully, but these errors were encountered:
Curious if you're implementing Jest tests currently or simply thinking ahead? Asking because we've yet to finish implementing built-in Jest support -- yes, you can run yarn rw test but as soon as you start importing it's failing all over the place. So if you're already up and running on your own, let's talk! 😀
Back to your question, yes, I think the way forward here will be jest.mock(). I'll fully defer to @peterp however.
Update on CRA Jest support:
Peter and Rob are just about done with test implementation for our CLI package. We'll use the fixtures pattern for CRA implementation as a helper/utility. For examples see here and here. Mentioning this in the case it seems we should sync this request with next steps on CRA Jest support.
Jest doesn't know how to handle .svg imports.
A mock transformer should be implemented.
What I usually do is just transform the SVG into an empty module (in this case it needs to be something react-y I assume since
svg-react-loader
transforms SVG's into Components.What is a good generic way to transform SVG's like that? Is stubbing them out to be nothing too limiting for some people who want to assert on the SVG?
Happy to create a PR if we can clear this up!
The text was updated successfully, but these errors were encountered: