Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Run in the Browser #293
A build script would definitely be the way to go here. This is pretty much how Jasmine works. It generates an html file that will run your tests when opened in a browser this makes it pretty easy to run the tests in a quick standalone manner.
As for integration with Phantom/Selenium that same html file is opened in the browser and the and the results are reported over an iframe/socket to the runner which in turn reports the pass/fail to other reporters like the console.
Thats a pretty high level overview of how it works in libraries like Jasmine (which I'm the most familiar with).
I'm almost wondering if Browserify could be leveraged to create a standalone vows.js file that could be used in a browser ill experiment with it a little as a prototype.
I just ran a quick proof of concept trying to browserify vows and there on only a few parts that Browserify chokes on. https://github.com/cloudhead/vows/blob/master/lib/vows.js#L163-L206 and https://github.com/cloudhead/vows/blob/master/lib/vows.js#L253-L255 commenting out those lines I was able to run vows tests in a browser. There is also a point where it chokes in the console reporter but we wouldn't be using that in the browser anyway since there would be reporters created specifically for browsers.
Here is a gist with the process https://gist.github.com/patrickarlt/7607314.