Javscript Unit Testing with Eclipse and JS Test Driver

To get started unit testing with Javascript and Eclipse, you’ll need Eclipse installed with the Javascript Development Tools plugin installed.

From the main menu bar click Help > Install New Software…

Click the “Add” button next to the “Work With:” text seleciton box.

Enter “http://js-test-driver.googlecode.com/svn/update/” into the Location field and enter a Name of your choosing or leave it blank to use the default location as the name.

Select the “JS Test Driver” plugin under “JS Test Driver Plugin for Eclipse” and click Next through the dialogs.

Once the plugin is installed, you can bring up the JSTestDriver view by clicking Window > Show View > JsTestDriver from the main menu bar.

You may want to configure the paths to the browsers for the quick open buttons by clicking Window > Preferences from the main menu bar.  Choose JS Test Driver on the left pain and then select the paths to the various browsers.

To start unit testing click the “Start Server” play arrow icon in the JSTestDriver view and click on the button for the web browser of your choosing.