Amy Blankenship
May 28, 2023

--

The statement I was responding to said that adding a _unit test_ broke the code. Unit tests should not in any way be able to break the code they are testing.

But to answer you question, when I am changing functionality, I nearly always change the test first to reflect the new behavior (so I break the test before I change the code, and then the change in the behavior of the code fixes the test).

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

Responses (1)