4
votes

I want to include a run of my Jasmine JavaScript tests when building my solution but can't really find any good walkthroughs or tutorials on how to do this.

Previously we had chutzpah install on the build server and this would run the tests but builds on TFS2012 are a bit different to VSO. Someone has mentioned to me that the karma extensions would be useful but not sure where to start yet.

Any tips welcome.

1
Just diging deeper and looks like I can add various types of steps to VSO build definitions so there are Grunt, Gulp ones that I may be able to use? Not sure how yet but will keep searching - Anthony Joanes
I've tried a new step in the build that points to **test.js; and pointed the "Path to custom test adapters" to the JSRunners that I have included in the solution but still getting problems with test adapter not being recognized. - Anthony Joanes
I've managed to add a "Command Line" build step which points to my chutzpah.console file with arguments to the test file locations. This does indeed run the tests and I can see the results in the console when the build runs. - Anthony Joanes

1 Answers

3
votes

I recently wrote a blogpost about enabling JavaScript unit tests in Visual Studio Online (Visual Studio Team Services :)) Hopefully this helps a little.