

Unit Testing 101: Are You Testing Your JavaScript? - reybango
http://msdn.microsoft.com/en-us/scriptjunkie/gg655487.aspx

======
bwindels
A blog post on MSDN promoting the use of google and java software
(JsTestDriver) and not even mentioning visual studio, times have changed
indeed.

~~~
ch0wn
I might be wrong, but those scrollbars in the screenshot look a lot like
Ubuntu's.

~~~
akavlie
Yep, you're right! The author works for Gitorious too.

Despite the fact that this is a Microsoft blog, the content is about the
furthest you can get from MS-centric development. Everything he endorses is
open source, from sources other than Microsoft. It's kind of amazing.

------
DanielRibeiro
Jasmine is also a great framework for testing. It work headless (nodejs) and
on web (for those rare times you want to debug a test):
<http://pivotal.github.com/jasmine/>

~~~
trungonnews
agree

------
MartinCron
It always annoys me when people talk about test automation (TDD, unit testing,
whatever) in the context of "finding bugs".

Test automation is about preventing bugs.

~~~
cjohansen
Test automation is about preventing bugs, sure. And TDD is about software
design. I don't disagree.

However, unit testing is also a nice way to find bugs. In any case, "trapping"
a bug like I did in this article is often an effective way of introducing
newcomers to what a unit test is.

~~~
MartinCron
It was a good article. And using automated tests to trap and isolate problems
is an important technique.

I didn't mean my nit-picking to come across as harsh and dismissive. I just
get hung up on people talking about writing tests to find bugs, because if
that's all it is about, manual testing is generally faster in the short-run.

------
fish2000
Relatedly: what is with MSDN bloggers always referring to themselves as
'junkies'? A "script junkie" probably won't steal their mother's VCR and pawn
it so they can get more scripts to stick in their arm. It's kind of a bizarre
convention.

~~~
nestlequ1k
Junkie has several different meanings: <http://en.wikipedia.org/wiki/Junkie>

------
rst
Another option is the test framework used for jQuery itself, QUnit:
<http://docs.jquery.com/Qunit>

~~~
augustl
I prefer JsTestDriver to any other JS test framework out there, for two
reasons: 1. You get feedback in your terminal 2. It scales better - run in
multiple browsers with one command, output results in junit XML for CI tools,
etc.

~~~
trungonnews
i believe you can make jsTestDriver to work with any other test framework such
as jamine js.

------
mckoss
Very nice summary of testing best practices - and surprisingly not Microsoft
specific!

------
trungonnews
if anyone didn't notice. that article is hosted by Microsoft.

since when did they develop on firebug, use open source tools, and hudson ci?
and practice TDD?

~~~
augustl
The author of that post is a guest author. I think most of the authors on that
blog are.

