(I strongly recommend not to copy your .js Sources from your Web Project to Test Project but to Link them to the Sources Folder)
2. Step was to add Chutzpah and Jasmine-Test Nuget Packages to my Project.
(I also recommend not to Check-In Packages to your TFS and to let your Build Server get the “fresh” version on every Build. On how to do that, read this link)
To do that, add new Visual Studio Test runner to your Build Definition and configure it like here:
The only two things you need to configure are:
- Test Assembly Wildcard, which was in my case all Files ending with Specs with .js extension, and in every Subfolder.
- Path to Custom Test Adapters, which should be pointing to local Sources Directory $(Build.SourcesDirectory) and then the Packages folder.
Really cool thing is that we don’t need to Check-In any binaries and have to update them from time to time. This way, on every Build, the MSBuild will get the latest NuGet Packages (Chutzpah in our case) and we will be using the latest binaries in our Visual Studio Test Runner.
Now, when you run the Hosted Build on your Visual Studio Online you should get Output like following:
In Logs of the Build Process you can then see all information about which Specs Files are tested and which Methods were being tested.
Sep 22 2015, 02:34 PM