Giles Bowkett: TDD In JavaScript: No Excuses
I really enjoyed Gile’s latest post to come out of last weeks Madison Ruby Conf on the topic of using test driven development for your javascript. The writing is on the well folks, time to get used to writing tests for your javascript.
From his post:
Nonetheless, if you’re not writing your JavaScript TDD, you’re out of your fucking mind. It’s just so fucking EASY, and it’s such a quirky language with so many pitfalls. Writing JavaScript without tests is like having sex without a condom, except worse, because it’s the wiggiest language out there, and it can turn on you at any second, so it’s more like having sex with a rabid orangutang without a condom during the act or a taser to subdue it afterwards so you can make your escape. Look, just write fucking tests when you write fucking JavaScript, OK? Seriously, what the fuck.
Nonetheless, if you’re not writing your JavaScript TDD, you’re out of your fucking mind. It’s just so fucking EASY, and it’s such a quirky language with so many pitfalls. Writing JavaScript without tests is like having sex without a condom, except worse, because it’s the wiggiest language out there, and it can turn on you at any second, so it’s more like having sex with a rabid orangutang without a condom during the act or a taser to subdue it afterwards so you can make your escape.

Look, just write fucking tests when you write fucking JavaScript, OK? Seriously, what the fuck.
Here’s a quick video showing how easy it is. The video uses CoffeeScript but everything in it translates very, very easily and directly into JavaScript; all you do is add punctuation. By the way, I wrote a lot of the code and the tests in this video while sitting in the audience of this testing talk. It’s so easy you can do it without even fully paying attention to it because you’re also busy listening to somebody tell you how allegedly impossible it is.
If are not familiar with Giles work, by all means, go familiarize yourself with it.





