As the guys from Mozilla say “The JavaScript shell provides a simple way to run scripts in batch mode or an interactive environment for exploratory programming.”
So basically you can create some tests for you app based on javascript without needing a browser, but using rhino.
With Mootools is a little complicated, as it needs a browser environment to run, and rhino does not provide this.
The solution for this is to simulate a browser.
A great work in this direction is made by John Resig, the guy behind jQuery, here. Only that you will need to modify a little the script, to work with Mootools.
Add the following lines at the very end of the env.js script
var document = window.document; window.Element = window.DOMElement; window.navigator.platform = "MacPPC";
window.navigator.platform can be any platform, I used this to reflect my own platform.

Leave Your Response