Solution I can live with for now
For both the jasmine test files and the files under test I added "Always copy" in properties as per the Chutzpah documentation. I didn't realise that the files under test were actually being copied to the builds bin folder along with the jasmine test files. So on the build server I ended up with the following struacture
bin
scripts
app
* application js files
specs
* jasmine test files
In my jasmine test file I add two references:
- The first to the Visual Studio directory sturcture of the file to be tested
- The second to the build bin folder structure
Hack 1
I can get it to work by adding another reference to my jasmine test file which uses the structure of the build directory and not the solution directory structure but again this is open to error as the path may be typed in incorrectly.
The second reference below will allow the tests to run in both VS Test Explorer and TFS Build
/// <reference path="../../../../../../App.Web/scripts/app/home/datecontrol.js" />
/// <reference path="../../../../../_PublishedWebsites\App.Web/scripts/app/home/datecontrol.js" />
Hack 2
By adding an xcopy command to the post-build build event of the project I can copy the files to be tested into the same location as the jasmine test files.