Automated Unit Testing with JavaScript

2019-01-29 18:21发布

I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently JSUnit works well with JUnit, but it seems to be abandonware and lacks good support for AJAX, debugging, and timeouts.

Has anyone had any luck automating (with ANT) a unit testing library such as YUI test, JQuery's QUnit, or jQUnit (http://code.google.com/p/jqunit/)?

Note: I use a custom built AJAX library, so the problem with Dojo's DOH is that it requires you to use their own AJAX function calls and event handlers to work with any AJAX unit testing.

14条回答
迷人小祖宗
2楼-- · 2019-01-29 19:14

Look into YUITest

查看更多
Melony?
3楼-- · 2019-01-29 19:16

There's a new project that lets you run qunit tests in a Java environment (like ant) so you can fully integrate your client-side test suite with your other unit tests.

http://qunit-test-runner.googlecode.com

I've used it to unit test jQuery plugins, objx code, custom OO JavaScript and it works for everything without modification.

查看更多
登录 后发表回答