When I want to test something in JavaScript, I open up a new browser window (mostly Firefox) and start writing code in the provided console (mostly Firebug).

However, this tends to be really tedious and slow. Is there an environment, like an IDE with self-execution capability for example, in which we can test JavaScript?

Guide: I'm looking for something like jsfiddle, but not in the browser, and not online. I'd like to have an execution environment which is both off-line, and is not a browser.

All I'm asking is to have something like the Firebug Console as a separate applications (preferably Windows application) which can be opened by double-clicking, and in which, you can write JavaScript code and hit execute. That's all.

In simpler terms, all I want is Firebug's console, without Firefox. Do we have such a thing on the market?

  • I found this page. It has plenty of these stand-alone shells for JavaScript. – Saeed Neamati Oct 11 '11 at 7:49

node.js is a popular server-side javascript platform.

It has a REPL that allows you to quickly test snippets. There are also other tools that can do this like the chrome console (I use it personally, responsive and fast) or the firefox6 scratchpad.

In combination with zombie or phantom, which are headless browsers, testing becomes a brease. You can easily write a suite of unit tests that interacts with your website.


Have a look at JS-Test-Driver by Misko Hevery http://code.google.com/p/js-test-driver/wiki/GettingStarted

Javascript is a language that is implemented inside browsers, so in order to test it outside, you would need a complete implementation of it.

But JS-Test-Driver "captures" the browser, thus making the whole process a bit easier and more automatic.


Selenium automates browsers.

And htmlUnit provides javascript testing functionality for Java.


If you just want the JavaScript language, either Rhino or V8 work as command-line environments, complete with a REPL. Most developer editors allow you to send the text content to a command-line process.

If, on the other hand, you want to test a browser-like environment, complete with a DOM tree, you can try env.js, originally by John Resig (yes, the jQuery guy).

  • I would say libraries like jsdom are better alternatives to env.js. – Raynos Sep 17 '11 at 23:45

As others have mentioned, node.js is fantastic for testing Javascript. I just want to add that testing in Firebug may have unexpected results. Actually, the Firebug input is evaled, which is not exactly the same as executing the code as it is. For instance, all variables are created without the [[DontDelete]] flag. This post explains the matter in more detail.


When it comes to core-javascript testing you can consider about Rhino, a Mozilla project. It's much lighter than nodejs because Rhino is an implementation of core language only. But Rhino won't come handy for HTML manipulation as Firebug.

Not the answer you're looking for? Browse other questions tagged or ask your own question.