[Unit Testing] Configure the Angular CLI to use the Karma Mocha test reporter

Every Angular CLI generated project comes already with Karmapreinstalled as well a couple of executable Jasmine specs. The default test reporter is "progress" which simply logs out the number of passed and failed tests. In this lesson we learn how to add the Karma Mocha test reporter to our Angular CLI setup.

 

Install:

npm i -D karma-mocha-reporter

 

Add to karma.config.js:

plugins: [
  ..
  require('karma-mocha-reporter'),
  ..
]

..

reporters: [
 'mocha', 'kjhtml'
]

 

Now the reporter will be more frinedly to read

posted @ 2018-02-16 19:46  Zhentiw  阅读(127)  评论(0编辑  收藏  举报