diff --git a/CHANGELOG.md b/CHANGELOG.md index dee4910..df6ef09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.2.2 (10/29/2017) + +- fixes a bug where coverage.get would kill the entire server + # 1.2.1 (10/28/2017) - adds a feed of most recent coverage updates diff --git a/dist/bundle.js b/dist/bundle.js index fd88184..65df114 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1,4 +1,4 @@ -webpackJsonp([0],{114:function(e){"use strict";e.exports.parseCoverage=function(e,t){var a=[[],[],[]];return e.forEach(function(e){var o=e.git,n=e.source_files;if(!t||t===(o.branch||o.git_branch)){var r=0,l=0,i=0,d=0;n.forEach(function(e){var t=e.lines,a=void 0===t?{hit:0,found:0}:t,o=e.branches,n=void 0===o?{hit:0,found:0}:o,s=e.functions,u=void 0===s?{hit:0,found:0}:s;a&&n&&u&&(l+=parseInt(100*(a.hit/a.found||1)),i+=parseInt(100*(n.hit/n.found||1)),d+=parseInt(100*(u.hit/u.found||1)),r+=1)}),a[0].push(l/r),a[1].push(i/r),a[2].push(d/r)}}),1==a[0].length&&(a[0].push(a[0][0]),a[1].push(a[1][0]),a[2].push(a[2][0])),a}},162:function(e){e.exports={name:"lcov-server",version:"1.2.1",description:"\uD83C\uDFAF A simple lcov server & cli parser",main:"index.js",homepage:"https://github.com/gabrielcsapo/lcov-server#readme",repository:{type:"git",url:"git+https://github.com/gabrielcsapo/lcov-server.git"},engines:{node:">= 4"},bugs:{url:"https://github.com/gabrielcsapo/lcov-server/issues"},scripts:{lint:"eslint .",test:"tape test/lib/**/*.js test/index.js",coverage:"tap test/lib/**.js --coverage --coverage-report=lcov",build:"npm run build:client && npm run build:server","build:server":"babel index.js --out-dir ./distributed && babel lib --out-dir ./distributed/lib && babel bin --out-dir ./distributed/bin && cp package.json ./distributed/ && cp -r dist ./distributed","build:client":"NODE_ENV=production webpack --progress",start:"./bin/lcov-server.js --serve",dev:"NODE_ENV=development webpack-dev-server --hot --port 5000",pack:"pkg bin/lcov-server.js -c package.json -o packed/lcov-server","generate-docs":"tryitout --output=docs --template=product && jsdoc -c jsdoc.json",storybook:"start-storybook -p 6006","build-storybook":"build-storybook --output-dir ./docs/storybook"},author:"Gabriel J. Csapo ",bin:{"lcov-server":"./distributed/bin/lcov-server.js"},pkg:{scripts:["index.js","bin/*","lib/**/*"],assets:["src/**/*","dist/**/**","node_modules/openbadge/**/**"],targets:["node8-macos-x64","node8-linux-x64","node8-win-x64"]},license:"Apache-2.0",dependencies:{"babel-polyfill":"^6.26.0",commander:"^2.11.0",compression:"^1.7.1",express:"^4.16.2","git-url-parse":"^7.0.1",mongoose:"^4.12.4",moment:"^2.19.1",openbadge:"^1.0.4","serve-static":"^1.13.1","update-notifier":"^2.3.0",xml2js:"^0.4.19"},devDependencies:{"@storybook/addon-knobs":"^3.2.13","@storybook/react":"^3.2.13","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-minify-webpack-plugin":"^0.2.0","babel-preset-env":"^1.6.1","babel-preset-react":"^6.24.1","body-parser":"^1.18.2","css-loader":"^0.28.7",docdash:"^0.4.0",eslint:"^4.10.0","eslint-plugin-react":"^7.4.0",getstorybook:"^1.7.0","highlight.js":"^9.12.0",jsdoc:"^3.5.4",pkg:"^4.2.5","prop-types":"^15.6.0","psychic.css":"0.0.1",react:"^16.0.0","react-dom":"^16.0.0","react-router-dom":"^4.2.2","react-select":"^1.0.0-rc.10",shelljs:"^0.7.8","style-loader":"^0.19.0",tap:"^10.7.2",tape:"^4.8.0",tryitout:"^0.3.7",webpack:"^3.8.1","webpack-dev-server":"^2.9.3","whatwg-fetch":"^2.0.3"}}},163:function(e,t,a){"use strict";function o(e){if("string"!=typeof e)throw new Error("The url must be a string.");var t=r(e),a=t.resource.split("."),n=null;switch(t.toString=function(e){return o.stringify(this,e)},t.source=2= 4"},bugs:{url:"https://github.com/gabrielcsapo/lcov-server/issues"},scripts:{lint:"eslint .",test:"tape test/lib/**/*.js test/index.js",coverage:"tap test/lib/**.js --coverage --coverage-report=lcov",build:"npm run build:client && npm run build:server","build:server":"babel index.js --out-dir ./distributed && babel lib --out-dir ./distributed/lib && babel bin --out-dir ./distributed/bin && cp package.json ./distributed/ && cp -r dist ./distributed","build:client":"NODE_ENV=production webpack --progress",start:"./bin/lcov-server.js --serve",dev:"NODE_ENV=development webpack-dev-server --hot --port 5000",pack:"pkg bin/lcov-server.js -c package.json -o packed/lcov-server","generate-docs":"tryitout --output=docs --template=product && jsdoc -c jsdoc.json",storybook:"start-storybook -p 6006","build-storybook":"build-storybook --output-dir ./docs/storybook"},author:"Gabriel J. Csapo ",bin:{"lcov-server":"./distributed/bin/lcov-server.js"},pkg:{scripts:["index.js","bin/*","lib/**/*"],assets:["src/**/*","dist/**/**","node_modules/openbadge/**/**"],targets:["node8-macos-x64","node8-linux-x64","node8-win-x64"]},license:"Apache-2.0",dependencies:{"babel-polyfill":"^6.26.0",commander:"^2.11.0",compression:"^1.7.1",express:"^4.16.2","git-url-parse":"^7.0.1",mongoose:"^4.12.4",moment:"^2.19.1",openbadge:"^1.0.4","serve-static":"^1.13.1","update-notifier":"^2.3.0",xml2js:"^0.4.19"},devDependencies:{"@storybook/addon-knobs":"^3.2.13","@storybook/react":"^3.2.13","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-minify-webpack-plugin":"^0.2.0","babel-preset-env":"^1.6.1","babel-preset-react":"^6.24.1","body-parser":"^1.18.2","css-loader":"^0.28.7",docdash:"^0.4.0",eslint:"^4.10.0","eslint-plugin-react":"^7.4.0",getstorybook:"^1.7.0","highlight.js":"^9.12.0",jsdoc:"^3.5.4",pkg:"^4.2.5","prop-types":"^15.6.0","psychic.css":"0.0.1",react:"^16.0.0","react-dom":"^16.0.0","react-router-dom":"^4.2.2","react-select":"^1.0.0-rc.10",shelljs:"^0.7.8","style-loader":"^0.19.0",tap:"^10.7.2",tape:"^4.8.0",tryitout:"^0.3.7",webpack:"^3.8.1","webpack-dev-server":"^2.9.3","whatwg-fetch":"^2.0.3"}}},163:function(e,t,a){"use strict";function o(e){if("string"!=typeof e)throw new Error("The url must be a string.");var t=r(e),a=t.resource.split("."),n=null;switch(t.toString=function(e){return o.stringify(this,e)},t.source=2 { if(err) { return reject(err); } // this might happen if the data is malformed - if(docs.length > 1) { + if(docs.length == 1) { + docs[0].history = docs[0].history.sort((a, b) => { + return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1; + }); + return resolve(docs); + } else if(docs.length > 1){ var condensed = docs[0]; for(var i = 1; i < docs.length; i++) { condensed.history = condensed.history.concat(docs[i].history); @@ -189,11 +194,9 @@ module.exports.get = function get(repo, limit) { return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1; }); return resolve([condensed]); + } else { + return reject('no coverage was found'); } - docs[0].history = docs[0].history.sort((a, b) => { - return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1; - }); - return resolve(docs); }); }); }; diff --git a/package.json b/package.json index 5d74cc7..1760b37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lcov-server", - "version": "1.2.1", + "version": "1.2.2", "description": "🎯 A simple lcov server & cli parser", "main": "index.js", "homepage": "https://github.com/gabrielcsapo/lcov-server#readme",