Not sure about the structure of testing JavaScript modules, although I'm sure there is one. But I will probably look at Rhino as a JS translator.
http://www.mozilla.org/rhino/
If your JS links to any of the browsers / DOM, you will also need to mock them ...
source share