# \[ANN\] js-developer plugin

**URL:** <https://www.ruby-forum.com/t/ann-js-developer-plugin/120143>\
**Category:** Rails\
**Created:** [November 14, 2007, 3:39am UTC](https://www.ruby-forum.com/t/ann-js-developer-plugin/120143 "2007-11-14T03:39:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jruyle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@jruyle](https://www.ruby-forum.com/u/jruyle)\
**Post date:** [November 14, 2007, 3:39am UTC](https://www.ruby-forum.com/t/ann-js-developer-plugin/120143/1 "2007-11-14T03:39:10Z")

</div>

# Javascript Developer Plugin

This plugin makes it easy to do TDD and/or BDD Javascript development.  
Included  
are generators to facilitate building Javascript tests and applications,  
along with  
Rake tasks for easily running these tests in a browser of your choice.

Many thanks to the javascript\_test plugin. If you want  
[Script.taculo.us](http://Script.taculo.us)’s  
unittest.js,  
then please go use this plugin. I’ve taken it and converted to use  
JSUnit.

== Generators ==

- js\_class / js\_file

These generators accept relative paths as well as plain class names, so

script/generate js\_class my\_js\_app/my\_class

will produce:

```
create public/javascripts/
create test/javascripts/unit/my_js_app
create public/javascripts/my_js_app/my_class.js
create test/javascripts/unit/my_js_app/my_class_test.html

```

There’s only a slight difference from js\_class and js\_file: js\_class  
gives  
you an  
Object template, while js\_file gives you an empty .js file.

== Rake tasks ==

rake test:javascripts - Runs all javascript tests

This task takes a couple of command-line arguments:

- KEEP\_ALIVE=true will keep the test server up for current development  
use

- BROWSER=[browser name] lets you select which browser to run the tests  
under:

---

<div class="post-metadata">

**Author:** ![jruyle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@jruyle](https://www.ruby-forum.com/u/jruyle)\
**Post date:** [November 14, 2007, 2:38pm UTC](https://www.ruby-forum.com/t/ann-js-developer-plugin/120143/2 "2007-11-14T14:38:50Z")

</div>

On Nov 13, 2007 9:38 PM, Jason R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> unittest.js,  
> create test/javascripts/unit/[classname]\_test.html  
> create test/javascripts/unit/my\_js\_app/my\_class\_test.html

Of course, I forget a very important piece of information:

How to Install:

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

Project Homepage:

[http://js-developer.rubyforge.org/](http://js-developer.rubyforge.org/)

Jason
