I have a standard ASP.NET MVC (version 2 preview 2) solution with the actual project and server-side unit tests in separate projects.
Because this project is very clie
I like your idea of placing the QUnit tests in a separate project. What about using XCOPY
to copy the scripts in the pre-build event?
Say your MVC project is MyProj.Web and your QUnit test project is MyProj.ClientTest (replace with your project names).
Create a Scripts folder in your ClientTest project.
From Project > MyProj.ClientTest Properties > Build Events, add the following to Pre-build event command line:
XCOPY "$(SolutionDir)MyProj.Web\Scripts" "$(ProjectDir)Scripts" /S /Y
Then in your HTML just include the appropriate JavaScript files from the Scripts folder.
Note: You will have to rebuild your ClientTest project to refresh JavaScript files when you want to rerun tests. Adjust folder names, paths and XCOPY
options as needed.