开发者

Javascript unittesting frameworks

开发者 https://www.devze.com 2023-01-06 05:32 出处:网络
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 runn

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开发者_如何学C?


QUnit is worth reviewing


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消