DEV Community

Cover image for JS&Friends Conf: Test Them JavaScripts - Rob Tarr
Adam Romig 🇵🇭
Adam Romig 🇵🇭

Posted on

JS&Friends Conf: Test Them JavaScripts - Rob Tarr

Test Them JavaScripts - Rob Tarr

Rob Tarr

Rob of Sparkbox started his discussion on testing with a few questions for us:

  • What does testing mean to your team?
  • How do you test?
  • How often do you test?

Some answers:

  • Piece of mind, consistency
  • Manually in browser, while developing (TDD), with testing libraries
  • Rarely, all the time, during CI, before pushing to repository

He continued with why we test our code. It does give us piece of mind & consistency as well as giving confidence in the code and ourselves & designing better software because of it. But where do we start - especially when web development has had a culture not testing for so long? For whatever reasons, it's hard, there's no time or it's just an afterthought.

Rob listed out a few testing frameworks: Mocha, Ava, Jest, & Jasmine; though he was going to concentrate on Mocha (with the Chai add-on) for this short session. He mentioned different runners to use to initiate the tests: Grunt, Gulp, Karma, Make, npm.

Establishing boundaries of what to test is a very important point so that time is not wasted testing things that were (probably) already tested. He called it the concept of mowing your own yard. Don't test libraries and APIs. Just test your code.

I believe there was supposed to be more to the talk and possibly examples of how to start writing the tests - where do I begin? But with only 50 minutes available, it may have been cut short of that. I am aware of my knowledge gap in automated testing and I will definitely educate myself more on it.

← Back to main JS&Friends article

Top comments (0)