Skip to content Skip to sidebar Skip to footer

Integrating Javascripts Unit Tests Code Coverage In MSBuild

I am using Jasmine and Karma for writing unit tests and code coverage. I have created the tasks using Gulp and running them through task runner explorer in VS 2015 update 3. I wa

Solution 1:

I have implemented one solution which fails MSBuild whenever any Unit Test failed. Basically I wrote a Custom Target in my project.csproj file which runs after 'CompileTypeScript' target.

<PropertyGroup>
    <CompileDependsOn>
      $(CompileDependsOn);
      GulpBuild;
    </CompileDependsOn>
</PropertyGroup>
<Target Name="GulpBuild" DependsOnTargets="CompileTypeScript">
    <Exec Command="./node_modules/.bin/gulp task-name" />
</Target>

This task will run after Visual studio compiles TS to JS. In build server 'Path' variable is not set for 'gulp', that's why passing the command through node_modules .bin folder.


Post a Comment for "Integrating Javascripts Unit Tests Code Coverage In MSBuild"