unipept / unipept-visualizations

Visualisations used by Unipept, packaged for easy reuse in other projects.
MIT License
18 stars 6 forks source link

Add unit tests #53

Closed pverscha closed 3 years ago

pverscha commented 3 years ago

This PR adds Jest unit tests and a GitHub action that will automatically be executed after each push. Visual snapshots are used in this package to make sure that the appearance of visualizations didn't change due to an update. Note that the Treeview visualization cannot be tested using this approach at this point in time, due to lacking support for advanced SVG manipulations in JSDom (https://github.com/jsdom/jsdom/issues/2531).

The GitHub action also creates an artefact that can be downloaded, which contains all screenshots produced and all screenshot diffs if a test failed. Annotations that point to which line in the source code caused a failure are also automatically added.