Javascript Developer Plugin

What is it?

The Javascript Developer Plugin makes it easy to develop Javascript libraries, helpers, and even full applications in a Test-Driven or Behavior-Driven way. Building off of the excellent javascript_test plugin, this plugin includes generators for setting up javascript file and test skeletons as well as rake tasks to run the tests themselves.

This plugin makes use of jsUnit, as well as jsMock, a JavaScript mocking library.

Rubyforge project page is here.

Installation

script/plugin install svn://rubyforge.org/var/svn/js-developer

Generators

$> script/generate js_class test_class
create public/javascripts/
create test/javascripts/unit/
create public/javascripts/test_class.js
create test/javascripts/unit/test_class_test.html

Rake Tasks

test:javascripts
Runs all the jsUnit tests under test/javascripts.

Options include:
  • BROWSER: select which browser to run tests in (default: firefox)
  • KEEP_ALIVE=true: select whether to keep the server running
  • (available browsers: firefox, safari, konqueror, ie)