From 64bd9d1e14c071e53668c08f4ce56710b1f083a8 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Thu, 22 Mar 2018 15:09:59 +0100 Subject: [PATCH 1/4] Added support for travis upload test coverage to coveralls. --- .travis.yml | 3 ++- seasoned_api/package.json | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db5320c..f9d3297 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,8 @@ node_js: '8.7.0' git: submodules: true script: - yarn test + - yarn test + - yarn doc before_install: - cd seasoned_api before_script: yarn diff --git a/seasoned_api/package.json b/seasoned_api/package.json index 48f08f6..1cb0b46 100644 --- a/seasoned_api/package.json +++ b/seasoned_api/package.json @@ -9,6 +9,7 @@ "scripts": { "start": "cross-env SEASONED_CONFIG=conf/development.json NODE_PATH=. node src/webserver/server.js", "test": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. mocha --recursive test", + "cov": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. nyc mocha --recursive test && nyc report --reporter=text-lcov | coveralls", "coverage": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. istanbul cover -x script/autogenerate-documentation.js --include-all-sources --dir test/.coverage node_modules/mocha/bin/_mocha --recursive test/**/* -- --report lcovonly && cat test/.coverage/lcov.info | coveralls && rm -rf test/.coverage", "lint": "./node_modules/.bin/eslint src/" }, @@ -28,12 +29,14 @@ "sqlite3": "4.0.0" }, "devDependencies": { + "coveralls": "^3.0.0", "eslint": "^4.9.0", "eslint-config-airbnb-base": "^12.1.0", "eslint-plugin-import": "^2.8.0", "istanbul": "^0.4.5", "mocha": "^5.0.4", "mocha-lcov-reporter": "^1.3.0", + "nyc": "^11.6.0", "raven": "^2.4.2", "supertest": "^3.0.0", "supertest-as-promised": "^4.0.1" From d9f679603afbd48cc5d4a2159325a7e7f37f5ac9 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Thu, 22 Mar 2018 17:17:23 +0100 Subject: [PATCH 2/4] Command in travis config was doc, not cov. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f9d3297..58dade9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ git: submodules: true script: - yarn test - - yarn doc + - yarn cov before_install: - cd seasoned_api before_script: yarn From f30b46c3840c4ddba4b1bf7208977ea7bca9e151 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 22 Mar 2018 17:20:14 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8949108..79a99a3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # 🌶 seasonedShows [![Build Status](https://travis-ci.org/KevinMidboe/seasonedShows.svg?branch=master)](https://travis-ci.org/KevinMidboe/seasonedShows) +[![Coverage Status](https://coveralls.io/repos/github/KevinMidboe/seasonedShows/badge.svg?branch=coverage)](https://coveralls.io/github/KevinMidboe/seasonedShows?branch=coverage) [![Known Vulnerabilities](https://snyk.io/test/github/KevinMidboe/seasonedShows/badge.svg?targetFile=seasoned_api/package.json)](https://snyk.io/test/github/KevinMidboe/seasonedShows?targetFile=seasoned_api/package.json) [![DUB](https://img.shields.io/dub/l/vibe-d.svg)]() From 92cc094787eb573aa978829357395d678d279a0e Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Thu, 22 Mar 2018 18:24:42 +0100 Subject: [PATCH 4/4] Removed old coverage script and updated travis config. --- .travis.yml | 2 +- seasoned_api/package.json | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 58dade9..93f8278 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ git: submodules: true script: - yarn test - - yarn cov + - yarn coverage before_install: - cd seasoned_api before_script: yarn diff --git a/seasoned_api/package.json b/seasoned_api/package.json index 1cb0b46..9349cb4 100644 --- a/seasoned_api/package.json +++ b/seasoned_api/package.json @@ -9,13 +9,11 @@ "scripts": { "start": "cross-env SEASONED_CONFIG=conf/development.json NODE_PATH=. node src/webserver/server.js", "test": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. mocha --recursive test", - "cov": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. nyc mocha --recursive test && nyc report --reporter=text-lcov | coveralls", - "coverage": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. istanbul cover -x script/autogenerate-documentation.js --include-all-sources --dir test/.coverage node_modules/mocha/bin/_mocha --recursive test/**/* -- --report lcovonly && cat test/.coverage/lcov.info | coveralls && rm -rf test/.coverage", + "coverage": "cross-env SEASONED_CONFIG=conf/test.json NODE_PATH=. nyc mocha --recursive test && nyc report --reporter=text-lcov | coveralls", "lint": "./node_modules/.bin/eslint src/" }, "dependencies": { "bcrypt-nodejs": "^0.0.3", - "blanket": "^1.2.3", "body-parser": "~1.18.2", "cross-env": "~5.1.4", "express": "~4.16.0",