Karma test runner detailed test report in console

karma-runner

I just started with unit test my angular app with karma. Everything working as expected

Chrome 26.0 (Windows): Executed 1 of 1
Chrome 26.0 (Windows): Executed 1 of 1 SUCCESS (0.878 secs / 0.112 secs)

However, is there any way to output more info about the result of the test. For example, Suite and test names it is executing and their result. I've read few tutorials where Jasmine test result outputs in browser. I'm wondering it can be achieved in karma too.

Best Answer

I was looking for something similar, and found this: https://github.com/usrz/javascript-karma-verbose-reporter. Generates this kind of output:

$ karma start --reporters=verbose

Suites and tests results:

 - the app.router.config module :
   * contains a router property : ok
   * configures the router title : ok
   * should have a login route : ok
 - the organization module :
   * contains a state property : ok
   * should have a streams route after configuration : ok
   * when activated, should set state based on organization in route : ok
 - the streams module :
   * points to state : ok
   * loads organization streams upon activation : ok
   * loads organization streams via API : ok

Browser results:

 - PhantomJS 1.9.8 (Mac OS X 0.0.0): 9 tests
   - 9 ok

To make this a default option, you can add this to your karma config, e.g.:

reporters: ['verbose', 'junit']
Related Topic