Run Jest unit test with TFS 2015

Has anyone tried to integrate Jest benchmarks with TFS 2015? I tried to use the Chutzpah test adapter ( https://visualstudiogallery.msdn.microsoft.com/f8741f04-bae4-4900-81c7-7c9bfb9ed1fe?SRC=VSIDE ), but it could not recognize the jokes. I get below error: Unable to find Jest variable

When I run unit tests through "npm test", I get the results. However, to integrate with TFS 2015, I need a test runner that can run the Jest unit test so that I can run unit tests in conjunction with vstest.console.exe, which provides TFS 2015 so that it can manage the build results and publish the results to build the final report.

Any help would be appreciated!

Any test runner that can run tests using the command below should work (given that VS 2015 is installed on the system): "C: \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ CommonExtensions \ Microsoft \ TestWindow \ vstest.console.exe "" \ test.js "/ UseVsixExtensions: true

+4
source share
3 answers

I'm not sure about the joke, but there is a neat npm package that can convert TAP results to xUnit XMLformat, and then you can publish this to TFS.

Check out tap-hunit .

, javascript (AVA, Mocha, Jasmine ..). TAP, , tap-xunit, TFS.

, - :

npm test | tap-xunit > results.xml

tap-xunit XML. XML, xUnit, TFS. TFS 2015, vNext, . " ".

+3

Merlin answer, jest TFS2015 vNext ( create-response-app ):

, :

npm install -g jest-json-to-tap

npm install -g tap-xunit

  • jest json, package.json "test": "test": "test-scripts test --env = jsdom --json",

  • jest package.json: "": { "coverReporters": [ "cobertura" ]}

  • vNext build (TFS2015v4) :

. "npm", command = run, arguments = test - --coverage | jest-json-to-tap | tap-xunit > TEST-result.xml

. " ", format = JUnit

. " ", = Cobertura, = $(Build.Repository.LocalPath)\\cobertura-coverage.xml

  1. , "" "CI" = "true"

: - - - ...

Voila "! , .

+2

XAML, : Javascript Unit Tests Team Foundation Service Chutzpah

vNext, , Jasmine.JS( JavaScript) .

0
source

All Articles