Commit 0d17513f by lxyang

feat:运行报错兜底处理

parent d0c88dca
{
"name": "istanbul-middleware-ry",
"description": "Connect middleware for Istanbul to handle server-side as well as browser coverage use-cases for node apps",
"version": "0.0.6",
"version": "0.0.7",
"main": "lib/index.js",
"files": [
"lib"
......@@ -71,7 +71,7 @@
"mkdirp": "*",
"pm2": "^5.2.0",
"rimraf": "*",
"ry-istanbul-web": "^0.0.6",
"ry-istanbul-web": "^0.0.7",
"yui-lint": "*"
},
"engines": {
......
......@@ -297,17 +297,19 @@ function mergeClientCoverage(obj) {
return
}
var coverage = getCoverageObject()
Object.keys(obj).forEach(function (filePath) {
var original = coverage[filePath],
added = obj[filePath],
result
if (original) {
result = utils.mergeFileCoverage(original, added)
} else {
result = added
}
coverage[filePath] = result
})
if (Object.keys(obj) && Object.keys(obj).length) {
Object.keys(obj).forEach(function (filePath) {
var original = coverage[filePath],
added = obj[filePath],
result
if (original) {
result = utils.mergeFileCoverage(original, added)
} else {
result = added
}
coverage[filePath] = result
})
}
}
module.exports = {
getCoverageObject: getCoverageObject,
......
......@@ -11,13 +11,14 @@ const ASSETS_DIR = istanbul.assetsDir
const existsSync = fs.existsSync || path.existsSync
const url = require('url')
const express = require('express')
var bodyParser = require('body-parser');
const JS_RE = /\.js$/
const getPitchingPiles = core.getPitchingPile()
/**
* Set default max limit to 100mb for incoming JSON and urlencoded
* @type {String}
*/
var fileSizeMaximum = '1024mb'
var fileSizeMaximum = '10240mb'
var isExtended = true
function createHandler(opts, isAll) {
......@@ -30,6 +31,8 @@ function createHandler(opts, isAll) {
res.header('Access-Control-Allow-Headers', 'Content-Type')
next()
})
app.use(bodyParser.json({limit: '5000mb'}))
app.use(bodyParser.urlencoded({limit: '5000mb', extended: true}))
// using separete options objects to maintain readability as the objects are getting more complex
var urlOptions = { extended: isExtended, limit: fileSizeMaximum }
var jsonOptions = { limit: fileSizeMaximum }
......
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