Browser Harness ===============
Tested "Should work"Chrome 4+ ✓Firefox 3+ ✓Safari 3+ ✓Opera 10.61+ ✓IE 5.5+ ✓IE 8+ ✓iOS ✓Android ✓PhantomJS ✓SlimerJS ✓Other ✓
A standalone example of using browser harness can be found under the browser-harness-bootstrap-tests repository.
The following example uses mocha, but any test framework may be used.
The module has built-in support for fibers via asyncblock](https://github.com/scriby/asyncblock). To take advantage of it, all you need to do is install asyncblock from npm and wrap your test with it (see above for an example).
Browser harness will auto-detect that asyncblock is being used and turn all asynchronous calls into "blocking-style".
Note that using fibers to write the tests is optional, but it is highly recommended. See no-fibers.js for an example of writing tests without fibers.
Due to the way browser harness interacts with the browser, there are a few limitations.
There are tests for browser harness located under the "tests" folder.
To run the tests:
cd tests#Install test dependenciesnpm install#Run test with mocha. Set a 10 second timeout as sometimes it takes a bit for the browser to open initially#You can also use your global mocha installation if you have it installed already./node_modules/mocha/bin/mocha all_tests.js -R spec -t 10000#Edit the test_browser file to run the tests in a different browser (defaults to phantomjs)