Testing Custom React Hooks With State Machines
Nick Christiansen
Junior Software EngineerHi! My name is Nick Christiansen and I am Software Engineer on a Planning & Scheduling team at Assignar. Recently, we started building new React table views to replace existing Angular 1.x tables. Finding the right pattern which will scale, while allowing iteration was both a key objective and a challenge. One of the solutions for this was a custom React hook to manage the table state. To be able to iterate with confidence, without regression, having tests around it was critical. This article will show a simplified example of how we implement tests on our own custom useTable React hook.