I've been using QUnit to test some javascript in my Visual Studio 11 solution and recently updated Resharper that supports QUnit in its testrunner.
When i manually ran the tests before, i would load the html page that loads my javascript to be tested as well as the qunit.js. My javascript would load - and run some initializing/support code which is required for everything to work.
In resharper i find that the scripts are not run and thus, many of my tests fail.
What would be the best way of solving this?
Ok, it seems there isn't much i can do about the problem in ReSharper till they add the feature of modifying the html.
I the mean time i had a little help from http://www.phantomjs.org/ which is a framework to run a headless browser. With that i can make a script that needs no UI, that does the testing - there is even a runner for QUnit right off the bat here http://code.google.com/p/phantomjs/wiki/ServiceIntegration#QUnit_Driver With that I'm able to run the tests, also in a CI environment.
That has to be good enough for now...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With