如何使用istanbul和jasmine生成节点应用程序的覆盖范围?

时间:2016-07-06 20:31:07

标签: node.js npm jasmine istanbul

目前我有一个包含此信息的package.json:

DELETE FROM...

我在ES6中有代码,而且我的测试是在ES6中编写的,我使用包含此信息的运行程序文件jasmine-runner.js运行测试:

"scripts": {
  "test": "babel-node test/jasmine-runner.js",
  "coveralls": "istanbul cover babel-node test/jasmine-runner.js && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
}

在我运行

之后
var Jasmine = require('jasmine');
var SpecReporter = require('jasmine-spec-reporter');
var noop = function() {};

var jrunner = new Jasmine();
jrunner.configureDefaultReporter({print: noop});    // remove default reporter logs
jasmine.getEnv().addReporter(new SpecReporter());   // add jasmine-spec-reporter
jrunner.loadConfigFile('test/support/jasmine.json');
jrunner.execute();

我有这个日志:

npm run coveralls

0 个答案:

没有答案