DEV Community

loading...

Test Driven Development in React: do you do it?

kallmanation profile image Nathan Kallman ・1 min read

Do you successfully practice TDD (e.g. a red-green-refactor loop) while creating React/ReactNative components? How do you set yourself up for success?

Discussion (1)

pic
Editor guide
Collapse
kallmanation profile image
Nathan Kallman Author

Where I love doing TDD in backend/server work, I've found it onerous to do red-green-refactor against React components...

It also seems most other people have given up as I see a large effort towards "snapshot" testing. Since you can't take a snapshot of something that doesn't exist yet, that approach cannot do TDD in any sense.