Customers

About

Electricity

Legal

COzero News


Archive for 3 April, 2017

Using mutant + snapshot testing to prevent regressions in D3 visualisations

Using mutant + snapshot testing to prevent regressions in D3 visualisations

D3 is a solid data visualisation tool but writing tests for charts can be tricky due to the way D3 chains function calls together and the sheer amount of code that's involved in bootstrapping a chart. Snapshot testing is a low effort, high reward testing approach popularised by the Jest framework for testing React apps. I've had a go at using it with D3 charts and found it works well with some caveats.
Continue reading