Well, you should still run them in the browser, but there are several console tools that let you test the browser.
Yeoman - http://yeoman.io/ is a tool released by the Google dev team that includes phantomjs as part of the task of testing your code. Basically, it spins the mute browser, runs the tests, and then displays the results to the console.
Bunyip - http://ryanseddon.github.com/bunyip/ is also a great tool. It allows you to run tests in any browser that you can connect to (so you are not just attached to testing webkit, as with yoman / phantomjs). It has great integration with the browser, so you can automatically run the entire test suite on dozens of browsers.
You can also write a selenium test - http://seleniumhq.org - and run it through the command line.
source share