views:

55

answers:

3

Hi all,

I am loooking for a javascript unittesing framework and trying to decide if I should go with JSunit or not. My goal is to have the unittests run with my CI, possibly using a JSunit server that is running headless.

From people's experience, is this a good idea? Are there better frameworks that you would recommend for my goals, over JSunit?

+3  A: 

QUnit is worth reviewing

STW
Particularly if you're already using jQuery.
Frank Schwieterman
Thanks, it looks pretty awesome. What's more using HTMLUnit I can kick of the QUnit tests through Junit, so it looks pretty easy to integrate with our existing CI :D.
stevebot
+2  A: 

It depends on your requirements. If you are going to have to test DOM intensive code and need your tests put in separate pages and organized in suites I would recommend using JSUnit. It has a nice test runner, supports suites and fixtures as separate pages. The experience is much like any other xUnit framework.

korchev
+1  A: 

I have used JS Unit Test, not JS Unit, in an automated test environment, but it was run through Selenium. Using env.js or HTMLUnit you can create headless tests with most any JS unit testing library.

Personally I don't go headless. A headless browser is often an "ideal" browser and might not catch all those browser quirks. So I ultimately run my browser tests through a browser using Selenium. I use the Sauce Labs jar.

For other testing frameworks is a list on Wikipedia, Screw Unit looks nice if you like BDD.

The Who