Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading support script for Resharpers QUnit testrunner

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?

like image 479
Per Hornshøj-Schierbeck Avatar asked Nov 13 '22 21:11

Per Hornshøj-Schierbeck


1 Answers

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...

like image 66
Per Hornshøj-Schierbeck Avatar answered Dec 15 '22 07:12

Per Hornshøj-Schierbeck