From 2e4d7fd8126a04693ae2ae42e2fcc35918007f3c Mon Sep 17 00:00:00 2001 From: Sergey Sova <5620073+sergeysova@users.noreply.github.com> Date: Fri, 1 Dec 2017 00:10:20 +0300 Subject: [PATCH] test: Add travis and codecov (#25) #22 --- .travis.yml | 7 +++++++ codecov.yml | 11 +++++++++++ package.json | 4 +++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100644 codecov.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b51c641 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +sudo: off +node_js: + - 8.9.1 + - 9.2.0 + +after_success: npm run coverage diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..1ba5fff --- /dev/null +++ b/codecov.yml @@ -0,0 +1,11 @@ +comment: + layout: "reach, diff, flags, files" + behavior: default + require_changes: false # if true: only post the comment if coverage changes + require_base: no # [yes :: must have a base report to post] + require_head: yes # [yes :: must have a head report to post] + branches: null + +parsers: + javascript: + enable_partials: yes diff --git a/package.json b/package.json index d2d7f42..033c83b 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "main": "src/index.js", "scripts": { "test": "npm run test:lint && npm run test:code", - "test:code": "ava", + "test:code": "nyc ava", "test:lint": "eslint .", + "coverage": "nyc report --reporter=lcov > coverage.lcov && codecov", "dev": "cross-env DEBUG=rubot:* nodemon -e yaml,js,json -w locales -w src ./src", "start": "pm2 startOrRestart ./process.config.js", "migrate": "sequelize db:migrate", @@ -33,6 +34,7 @@ "homepage": "https://github.com/LestaD/ru_bot#readme", "devDependencies": { "ava": "^0.24.0", + "codecov": "^3.0.0", "cross-env": "^5.1.1", "eslint": "^4.12.0", "eslint-config-atomix-base": "^5.0.0",