Simple Script to Run QUnit in All Browsers Locally

Before you check in you should always run a full build.  If you have  javascript — you should run all your tests locally first before the build.  This is because most automated test systems like JSCover or PhantomJS only use Firefox or WebKit libraries. And most shops do not have access to the full test-in-all-browsers system like BrowserStackAPI with Bunyip yet.  Someday we’ll be doing that, but until then, run one of these (on Windows — Mac/Linux are easy enough).  Just make sure to have a web server running, serving up the QUnit code.  In my case I use HFS Http Server pointing at the source directory (tests and src).


REM this will start up 4 parallel browser instances and run the QUnit tests.

start "Firefox" "<full path to>\firefox.exe" http://localhost:88/test/js/qunit-require-tests.html?noglobals=true

start "IE" "<full path to>\Internet Explorer\iexplore.exe" http://localhost:88/test/js/qunit-require-tests.html?noglobals=true

start "Safari" "<full path to>\safari.exe" http://localhost:88/test/js/qunit-require-tests.html?noglobals=true

start "Chrome" "<full path to>\chrome.exe" http://localhost:88/test/js/qunit-require-tests.html?noglobals=true

REM end code

Comments are closed.