DEV Community

Discussion on: Introduction to Practical Test-Driven Development with JavaScript for beginners

Collapse
 
loujaybee profile image
Lou (🚀 Open Up The Cloud ☁️)

Also nice that you wrote your own little test runner. I remember watching some tutorial where someone did that and I remember being like... "oh... I can do that?". Then I started kicking myself since the true barrier to entry for tests is just one small test function (as you did). There's pretty much no excuse or reason not to.

Collapse
 
vladdubrovskis profile image
Vlad Dubrovskis

Thanks Lou!

I wanted to show that writing tests is all about a way of thinking and that it helps you navigate the problem. I like the idea around mocking/not mocking as have fallen to that trap too before where mocked out things to the point - so if will find more time for writing may write some more stuff around testing :)

I had to recently try and explain how testing works and realised that we are too used to tooling and in reality all it is just a function that makes sure that result matches the expectation. The frameworks are out there to make a lot of things easier but the basics are still the same.

And as you said - I think once it clicks and you see the benefit of it you just don't want to go back to not doing it :)

As someone on LinkedIn said: "I never understood why someone wouldn't write lots of tests! What kind of person doesn't like to consistently prove themselves right?"