New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run in the Browser #293

Open
JerrySievert opened this Issue Nov 22, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@JerrySievert
Copy link

JerrySievert commented Nov 22, 2013

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

This comment has been minimized.

Copy link

patrickarlt commented Nov 22, 2013

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

This comment has been minimized.

Copy link

patrickarlt commented Nov 22, 2013

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

This comment has been minimized.

Copy link
Author

JerrySievert commented Nov 22, 2013

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.

@evanp evanp added enhancement and removed rewrite labels Apr 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment