cyyynthia / vite-plugin-magical-svg

An all-in-one Vite plugin that magically makes working with SVGs and bundling them a breeze.
BSD 3-Clause "New" or "Revised" License
46 stars 6 forks source link

Write tests #14

Open cyyynthia opened 4 months ago

cyyynthia commented 4 months ago

Not sure what the best strategy would be here...

mary-ext commented 4 months ago

We can move the transformations out of the load hook so that we can do snapshot tests of the resulting SVG and JS code, that should be good for a start.

After that we can move on to browser screenshot testing, to make it easier to see if the SVGs are being shown correctly

cyyynthia commented 4 months ago

Sounds good to me. https://playwright.dev/docs/test-snapshots should be the most appropriate tool for the screenshot job; Ideally all browsers should have a very similar output but I don't know if the difference between render engines will require using different screenshots to compare.

Points to test are: