Quantcast
Channel: Chutzpah - A JavaScript Test Runner
Viewing all articles
Browse latest Browse all 1864

New Post: Console runner and the lack of exclusion options?

$
0
0
Hello,

I've been playing around with Chutzpah for the last few days and I could use some hints on how to best configure Chutzpah console for test results and code coverage with my automated .NET build.

I have the following project structure:
project.sln
project.csproj
project.msbuild
Module1/
Module1/src/module1.js
Module1/test/module1Spec.js
Module2/
Module2/src/module2.js
Module2/test/module2Spec.js
...
packages/
packages/Jasmine<version>/jasmine.js
packages/<other JS libs>/*.js
...

My goal is to run Jasmine specs using Chutzpah, providing test results for those specs in a junit result(s) file (consumable by some CI tool, e.g., Jenkins) as well as generating code coverage for all these spec files and *.js referenced with ///<reference .../> comments in a single HTML file.

I would gladly use Chutzpah directory scanning feature by simply providing Chutzpah with the "." directory and then letting it find all my specs. This however traverses deep down into my nuget packages/ directory doing lots of stuff with *.js files found there. I haven't been able to find a simple directory exclusion parameter to solve that approach.

And so I am scanning for specs myself and so far came up with the following piece of project.msbuild:
<Project ...>
  <ItemGroup>
    <TestSpecs Include="**\*Spec.js" />
  </ItemGroup>
  
  <Target Name="Test" DependsOnTargets="PackageRestore">
    <MakeDir Directories="$(TestResultsDir)"/>
    <Exec Command="$(ChutzpahExePath) %(TestSpecs.FullPath) /junit $(TestResultsDir)/%(TestSpecs.Filename).junit.xml /coverage" IgnoreExitCode="true"/>
  </Target>
  </Project>
However, the problem here is, that Chutzpah (given /coverage flag) does not simply append to the coverage html but overrides it. There's also no way (correct me if I'm wrong) to specify a different coverage HTML file name at each Chutzpah execution.

Could someone comment on whether I am missing some Chutzpah options and/or whether a reasonable feature request is emerging from my description?

Thanks

Viewing all articles
Browse latest Browse all 1864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>