-
Notifications
You must be signed in to change notification settings - Fork 5
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
Turning all pngs into svgs #93
Comments
Apparently you can do this on photoshop and I hear you're a photoshop wizard |
I'll look into it, test the logo and see whether the result is acceptable. I'm not sure whether this hack will work with photos of e.g. people etc., so I'll test a random photo from the original website to see whether it works and let you know. The thing with this hack is, it'll work for us but not for the clients: they'll be adding pdf, jpeg, jpg, png and perhaps gif files, as well as mp4 files and whatever else YouTube is using. So it makes sense to get Jest to stop failing tests when these file types are served. |
@harryyy27 I've been reading Jest's documentation to see whether there are any clues as to why image files fail the tests and noticed that in the Configuring Jest section, the advice is either to configure Jest at the top of the package.json (currently not the case)
or to set up a So, I wonder whether explicitly configuring jest, as the documentation suggests, then tweaking its default options, as described in the Defaults section, and including all relevant file types (e.g. png, gif, jpeg, jpg, svg, pdf, mp4 and whatever other file types YouTube uses) in the moduleNameMapper might stop Jest from failing those particular tests? This example of how to do that seems potentially useful:
We will need to find a way to get Jest to pass tests with various file types, because the clients will be adding images and video links, and the former will most likely be jpegs, jpgs, or pngs. |
That's a webpack solution. If the clients want to add photos. We can svg them automatically in our starting script if we have to |
Anyway I have another way of skipping them. So i guess it doesn't matter |
The example is for Webpack, the documentation is for Jest. If you've found a way of skipping image file types, can you add the remaining file types. i.e. gif, jpg, jpeg, pdf, mp4, perhaps flv too, as the clients will be adding various types of files? Thanks. |
I've found a nice piece of software that can turn all svgs into react components. This means they can be passed into jest tests without crashing the software. So we'll be needing our pngs and jpgs turned into svgs in case I can't comment some of them out or not render them
The text was updated successfully, but these errors were encountered: