If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unit testing tool for Javascript applications

Hello..
Could someone please tell me whether I can use Java Language to develop an automatic unit testing tool for Javascript functions or whether I should go for Javascript itself?
And may I please know all difficulties I might face if I would be using Java instead of Javascript itself to develop the testing tool.

The decision to unit test your JavaScript application with Java or JavaScript really depends on how the JavaScript application is architected.

The technically correct answer is "No, you cannot unit test JavaScript with Java" because they are different languages and platforms. You can use Java to perform functional testing on your JavaScript application, though. Check out Selenium, which allows you to programmatically control a web browser with Java code.

If you want to do true unit testing, where you isolate one component in your JavaScript application, then check out Jasmine. It is an RSpec style unit testing framework for JavaScript. I've used it quite a bit and I really like it.

My project is to develop an automatic unit testing tool for JavaScript and I was thinking of developing the tool on an another language like Java since all the existing ones are in JavaScript itself. It would not be of anything new if I was to do it in JavaScript itself.

But is there any specific reason why all existing unit testing tools like Jasmine, QUnit and all have been developed in JavaScript itself and not any other language?

Since JavaScript is a client-side it might be better and/or easier to write the Unit tests in another language. I also found out that I'll at least need to use Javascript to do the Submits and function calls.