Tag Archives: javascript

javascript testing

I have been messing around with javascript testing lately and i’ve had some issues.  I have been attempting to incorporate jsunit into JUnit (per the minimal instructions on the website) and have been unsuccessful.  emails to the site owner go unanswered.

The usage seems to be directed towards building via ANT/XML in something like CruiseControl, but I am trying to put it directly into a JUnit testcase that can be part of all of the other tests I run.

Here’s a summary of what i’m doing right now, and the problems i’m having:

  1. Create an instance of StandaloneTest, and supplying it with an implementation of ConfigurationSource
  2. Set up the test to be one that comes with the jsunit package… so that i KNOW it is formatting correctly.  (This is the html file with the javascript tests and asserts in it)
  3. run the unit test.

Step 3, of course, is what fails.  The browser I selected launches, and the java console says the everything is running and that it is waiting for a response.

Then it times out… I’m not sure what is going on here, but it seems that either the browsers are not sending a response, or JUnit is not able to catch it.

Any ideas?