DEV Community

Discussion on: Creating a React component with TDD

mbarzeev profile image
Matti Bar-Zeev Author

At the end of the day, we do what helps us the most.
I like to think of the test I'm writing as a solid ground I blindly rely on and therefor I usually don't refactor them. I refactor the code it tests, knowing they protect me from my mistakes.
In my eyes tests should as simple as possible, with no implicit side effects. I see the the title of a failed test and I know right away what happened, no assuming or guessing, and yes - I write a test to make sure a service method is there, for I am willing to pay that price ;)

Thread Thread
idanen profile image
Idan Entin

Well TDD brings refactoring freesom, so you're missing out ;)
Regarding blindly relying on them, you can still do that, since the tests are also tested - by the code