Step1:安装Istanbul
npm install -g istanbul
Step2:在package.json里面添加,具体参考Istanbul的API写法
"scripts": { "cover":"istanbul cover _mocha test/mocha.js" },
Step3:执行npm run cover