4

I'am trying to generate an xml file that contains informations about unit test coverage that i made with mocha ( Backend unit tests in Angularjs ).

I executed my front end unit tests with jasminejs and i can integrate the frontend coverage with cobertura plugin in jenkins.

My question is how can i do the same as in front end , but in backend this time ( with mocha ) ? I mean generate Mocha unit test coverage file and view it using Cobertura plugin in jenkins.

badaboum
  • 843
  • 2
  • 17
  • 28

1 Answers1

1

Look at this link

That refers to... https://www.npmjs.org/package/istanbul.

On first link, you can change ISTANBUL_REPORTERS=html,text-summary,cobertura to ISTANBUL_REPORTERS=cobertura

At the end, a file cobertura-coverage.xml will be generated. Publish this file in your jenkins with the Cobertura plugin.

Zafar
  • 3,394
  • 4
  • 28
  • 43