leeoniya / uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
MIT License
8.51k stars 371 forks source link

Screenshot testing #858

Open zefirka opened 9 months ago

zefirka commented 9 months ago

Hi there, long time no see 😄

Things is we're using uPlot as a core library for our own featurefull library. Currently I'm focused on improving stability and reduce regressions in our library, so I decided to cover it with screenshot tests. I think that fundamental tests (like a visualisation types, series and axes rendering) should cover uPlot, not our library, cuz it's actually uPlot's tests and it's better to keep them in uPlot's repo.

What do you think about screenshot testing? I setup screenshot testing in our repo and I can easily setup the same in uPlot and bring some base tests. I'm simply using puppeteer + jest to take screenshots, I was thinking about only-canvas approach, but found out that eventually I'll want to test interaction with HTML elements etc, so I stick with browser screenshots. If you don't like my approach, we can discuss it and modify for uPlot. Anyway I found that tests would be useful.