DEV Community

loading...

Discussion on: A Simple Way To Get Started With TDD

Collapse
lvlario0o0o profile image
Mario Lafleur

Should we write a test that pass the exception first, then we write a test that pass the correction?
Or maybe the way you do it make both of them at once?

Collapse
matheusrich profile image
Matheus Richard Author

I tend to write a test that reproduces the exact error that raised in production. Then I make the exception go away by fixing the bug.

So I think I do both at once. But if you can split those phases safely, should be equally valid.