Reporting JS Unit Tests
The other day I've had a discussion with some dear fellow testers on how it would be possible to report unit tests in a pretty way.
After having a closer look into our dev teams karma.conf.js file in our codebase, I stumbled over the
karma-jasmine-html-reporter and the
Nice I thought, but how could we get the first one into a pretty html file? Well, just add the
karma-htmlfile-reporter to your devDependency by simply doing
npm install karma-htmlfile-reporter --save-dev. This will then add it automatically to your package.json.
There you go, have fun with the pretty report.
–save-dev? That’s an option that updates the installed packages in the ‘devDependencies’ section of the package.json file. It signifies that a developer will need this package to work with the application, but it’s not required to run the application i.e. in production.)