PhantomJS allows you to simulate all the functionality of a web browser in your command line tests. Use it!