What is JavaScript unit testing? I am a web developer; how can I take advantage of this technique?
-
2http://stackoverflow.com/tags/unit-testing/info – Sergio Oct 05 '13 at 19:25
-
1https://www.google.com/search?q=unit+testing – user2357112 Oct 05 '13 at 19:31
2 Answers
Unit testing in JavaScript is the same concept as other languages. Since JavaScript takes place in modifying the HTML, the GUI modifications (adding/modifying elements etc') should be tested as well as the logic behind.
Reviews of popular JavaScript unit testing frameworks/tools:
Here is a list of popular JavaScript unit testing frameworks:

- 30,738
- 21
- 105
- 131

- 5,581
- 4
- 48
- 75
As others have suggested, you need to read up on unit testing in general and then on the unique challenges posed by JavaScript to good unit testing.
Aviran made a great suggestion with QUnit, but I think Jasmine is better suited for new developers because of its readability and BDD-ness.
Either way, you will be able to make the right choice for you and your applications as you try these tools and get more experience...and feel the pain of not having those unit tests.

- 30,738
- 21
- 105
- 131

- 29,932
- 7
- 42
- 70