A Series of My Unfortunate Mistakes (When Writing Tests)

briwa on July 06, 2019

Once upon a time, when I started writing tests long time ago (actually, not that long, maybe a few years ago), I was a naive young man. I hate bugs... [Read Full]
markdown guide
 

Love your writing style! It kept me interested all the way though. The lessons are great too!

 

Thanks! It means a lot since I just started writing two months ago, and I've kind of been shooting in the dark here. Glad that you like it. If you do have any feedback, do send them my way. Thanks, again.

 

I would argue that testing constructor that only assigns private initial value is unnecessary, seeing how you're testing methods that work with that value. After all, it doesn't matter what's going on inside a class if the output is correct.

 

You have a point. I've mentioned in the article, maybe if the constructor function has some logic, it can be tested and asserted as well. But true that, in the example I've given, testing the constructor itself might not mean that much, just putting it there.

 

Can relate to having those awkward testing skills 😅 Glad you learned along the way! And thanks for sharing them to us here 👍

 
 

One of your examples in section 3 has a missing quote mark, which throws off syntax highlighting completely.

 

Wow, nice catch! Thanks. I've amended the article.

 

Thanks for the article! There's some good testing tips in here that I'll definitely be keeping in mind with my next project 👍

 
code of conduct - report abuse