Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Run in the Browser #293

Open
JerrySievert opened this Issue · 3 comments

2 participants

@JerrySievert

This one is more complicated and will most likely require a build script for optimal usage, but it would be very nice to be able to run in the browser/phantomjs.

Tagging @patrickarlt for additional input.

@patrickarlt

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.

@patrickarlt

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.

@JerrySievert

Since this will be a ground up rewrite, wondering if maybe we should not use browserify but instead just write cleanly with no major dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.