I used Chutzpah to wrap this behavior for use in TeamCity. Chutzpah can run tests written in QUnit, Jasmine, or Mocha, and uses PhantomJS as a headless test leader.
https://github.com/mmanela/chutzpah
I installed it on the assembly agents and added it to the path on the machine.
Now I just add a command line command-line step called "Run JS Test" in my build template. The command line is simple:
chutzpah.console.exe %jsTestFolder%
Then I just define a parameter for each project pointing to a folder ... chutzpah does the rest.
source share