Commit 2b322b2d by lxyang

feat: 添加参数判断,服务出错的时候的兜底判断

parent 0b4aec06
...@@ -57,3 +57,6 @@ This plugin needs to be used with [babel-plugin-istanbul-ry](https://www.npmjs.c ...@@ -57,3 +57,6 @@ This plugin needs to be used with [babel-plugin-istanbul-ry](https://www.npmjs.c
* The [istanbul-middleware-ry](https://www.npmjs.com/package/istanbul-middleware-ry) istanbul viewing service is transformed from [istanbul-middleware](https://www.npmjs.com/package/istanbul-middleware), and the start service is added. The istanbul code coverage can be collected and viewed through the global command `coverage -n` start service. * The [istanbul-middleware-ry](https://www.npmjs.com/package/istanbul-middleware-ry) istanbul viewing service is transformed from [istanbul-middleware](https://www.npmjs.com/package/istanbul-middleware), and the start service is added. The istanbul code coverage can be collected and viewed through the global command `coverage -n` start service.
* [istanbul-middleware-ry](https://www.npmjs.com/package/istanbul-middleware-ry) istanbul查看服务由[istanbul-middleware](https://www.npmjs.com/package/istanbul-middleware)改造而来,增加启动服务,可通过全局命令`coverage -n`启动服务收集并查看istanbul代码覆盖率。 * [istanbul-middleware-ry](https://www.npmjs.com/package/istanbul-middleware-ry) istanbul查看服务由[istanbul-middleware](https://www.npmjs.com/package/istanbul-middleware)改造而来,增加启动服务,可通过全局命令`coverage -n`启动服务收集并查看istanbul代码覆盖率。
### 0.6版本
添加参数判断,服务出错的时候的兜底判断
...@@ -235,19 +235,27 @@ ...@@ -235,19 +235,27 @@
delete ret.l; //remove derived info delete ret.l; //remove derived info
Object.keys(second.s).forEach(function (k) { if (Object.keys(second.s).length) {
ret.s[k] += second.s[k]; Object.keys(second.s).forEach(function (k) {
}); ret.s[k] += second.s[k];
Object.keys(second.f).forEach(function (k) { });
ret.f[k] += second.f[k]; }
}); if (Object.keys(second.b).length) {
Object.keys(second.b).forEach(function (k) { Object.keys(second.b).forEach(function (k) {
var retArray = ret.b[k], ret.f[k] += second.f[k];
secondArray = second.b[k]; });
for (i = 0; i < retArray.length; i += 1) { }
retArray[i] += secondArray[i]; if (Object.keys(second.b).length) {
} Object.keys(second.b).forEach(function (k) {
}); var retArray = ret.b[k],
secondArray = second.b[k];
if (retArray.length) {
for (i = 0; i < retArray.length; i += 1) {
retArray[i] += secondArray[i];
}
}
});
}
return ret; return ret;
} }
......
{ {
"name": "ry-istanbul-web", "name": "ry-istanbul-web",
"version": "0.0.6", "version": "0.0.7",
"description": "Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale", "description": "Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale",
"keywords": [ "keywords": [
"coverage", "coverage",
...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
"wordwrap": "^1.0.0" "wordwrap": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"body-parser": "^1.20.1",
"coveralls": "2.x", "coveralls": "2.x",
"jshint": "^2.8.0", "jshint": "^2.8.0",
"nodeunit": "0.9.x", "nodeunit": "0.9.x",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment