Qunit + JSCoverage + Jenkins

后端 未结 2 610
太阳男子
太阳男子 2020-12-31 13:13

I have started using Qunit to test my JS code. I am looking into JSCoverage to generate the coverage reports later. We have a CI server (Jenkins) which already do a few thin

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 13:40

    A few more details, for those actually attempting this:

    Putting together QUnit and Jenkins

    If you want to run QUnit and publish the results in Jenkins, you'll need to do the following:

    Step 1: Getting QUnit to generate an XML file compatible with JUnit.

    • If you're using Apache Ant, this question explains how to get QUnit to generate XML.
    • If not, you can use Grunt and grunt-qunit-junit, together with grunt-contrib-qunit, to run your .html tests.
    • And if you're not into either Ant or Grunt, here is a script for PhantomJS to run your tests directly and produce JUnit-style XML.

    Step 2: Processing that XML file

    This is the easy step - look in "Post-build Actions" for your job in Jenkins, and add the path to the XML file.

提交回复
热议问题