add CircleCI build and generate coverage

This commit is contained in:
Luciano Balmaceda
2020-02-13 17:00:03 -03:00
parent d80bbe3ef5
commit a671147fe1
5 changed files with 1259 additions and 3 deletions
+34
View File
@@ -0,0 +1,34 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:10
environment:
LANG: en_US.UTF-8
steps:
- checkout
- run:
name: Update NPM version
command: sudo npm install -g npm@latest
- restore-cache:
name: Restore NPM Package Cache
keys:
- npm-packages-{{ checksum "package-lock.json" }}
- npm-packages-
- run:
name: Install Dependencies
command: npm install
- save-cache:
name: Save NPM Package Cache
key: npm-packages-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: Run Tests
command: npm run test:ci
- store_artifacts:
path: ./coverage/lcov-report
- run:
name: Upload Coverage
when: on_success
command: bash <(curl -s https://codecov.io/bash)
+3
View File
@@ -14,6 +14,9 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
+22
View File
@@ -0,0 +1,22 @@
coverage:
precision: 2
round: down
range: "80...100"
status:
project:
default:
enabled: true
target: auto
threshold: 1%
if_no_uploads: error
patch:
default:
enabled: true
target: 80%
threshold: 30%
if_no_uploads: error
changes:
default:
enabled: true
if_no_uploads: error
comment: false
+1198 -3
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -31,6 +31,7 @@
"koa-jwt": "^3.6.0",
"mocha": "^6.2.2",
"nock": "^10.0.6",
"nyc": "^15.0.0",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"rimraf": "^2.7.1",
@@ -46,6 +47,7 @@
"test:ts": "npm run clean:ts && tsc && NODE_ENV=test mocha --require babel-core/register --exit --timeout 5000 $(find ./ts-output -name *.tests.js)",
"test:js": "NODE_ENV=test mocha --require babel-core/register --exit --timeout 5000 $(find ./tests -name *.tests.js)",
"test": "npm run test:js && npm run test:ts",
"test:ci": "nyc --reporter=lcov npm test",
"test-watch": "NODE_ENV=test mocha --require babel-core/register --exit --timeout 5000 $(find ./tests -name *.tests.js) --watch",
"release": "git tag $npm_package_version && git push && git push --tags && npm publish"
},