O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JUnit reporter

A small but very useful plugin is karma-junit-reporter. When we are going to test our code using Jenkins, we want to know which tests failed and why. Our current progress reporter (which writes the results to the console) is not going to cut it. Jenkins makes use of the JUnit style XML to publish test results (not to be confused with coverage results). We can simply install the plugin and then add it to our reporters:

npm install karma-junit-reporter --save-dev

And in our configuration file, we can add it to reporters:

reporters: ['progress', 'junit', 'coverage'],

If you run your tests now, you should get a report for each browser and OS, for example, TESTS-IE_11.0.0_(Windows_10_0.0.0).xml. Of course, the JUnit reporter can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required