In Chapters 3 and 4, we saw some D3.js code encapsulation strategies and chose an abstraction: the Reusable API. Later in Chapter 5, we saw how to transform standard D3.js code into production-ready Reusable API components. However, to produce a real professional chart, we need to supply unit tests to the component.
In this chapter, we follow the steps to redo our example bar chart in a Test-Driven Development (TDD) way, achieving a professional chart with ample test coverage. We’ll cover the creation of unit tests for Reusable API components and go over the process of preparing a simple development ...