JavaScript Chart Testing

I am currently participating in a project where I collect diagrams using various libraries (d3 and nvd3 most of the time). I would like to create a set of automatic tests and see if the data that I load in the API that I am actually actually spitting out the data correctly.

How do you actually check the charts? Is unit testing the right way to do this, or is charting the only way to do this?

+4
source share
1 answer

You can use PhantomJS to take some screenshots: https://github.com/ariya/phantomjs/wiki/Screen-Capture

You can also compare the created DOM structure (what I did in this project: https://github.com/angular-d3/line-chart )

0
source

Source: https://habr.com/ru/post/1492683/


All Articles