From 507a227512acf33e4192e3ec54b5992a4c005994 Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Thu, 2 Aug 2018 12:22:46 +0200 Subject: [PATCH] Add nyc and coveralls for code coverage --- .gitignore | 1 + .npmignore | 1 + .travis.yml | 3 +++ README.md | 1 + package.json | 5 ++++- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c15adff3..945f3f8e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules/ test.sqlite db.sqlite db.sqlite-journal +.nyc_output/ diff --git a/.npmignore b/.npmignore index ae7effc6..a70b5ce2 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ .travis.yml build/ scripts/travis-before-install.sh +.nyc_output/ diff --git a/.travis.yml b/.travis.yml index e3d65403..e36a1a37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,5 +25,8 @@ install: script: - npm test +after_success: + - npm run coverage + notifications: email: false \ No newline at end of file diff --git a/README.md b/README.md index 6a3b184d..88edd532 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Build Status](https://travis-ci.org/deltachat/deltachat-node.svg?branch=master)](https://travis-ci.org/deltachat/deltachat-node) ![Node version](https://img.shields.io/node/v/deltachat-node.svg) +[![Coverage Status](https://coveralls.io/repos/github/deltachat/deltachat-node/badge.svg)](https://coveralls.io/github/deltachat/deltachat-node) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) **WORK IN PROGRESS** The API can change at any time and will not follow semver versioning until `v1.0.0` has been released. diff --git a/package.json b/package.json index a6ba8935..0c253557 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "node-gyp rebuild --debug --verbose", "submodule": "git submodule update --recursive --init", "install": "./scripts/rebuild-all", - "test": "standard && node test/index.js" + "test": "standard && nyc node test/index.js", + "coverage": "nyc report --reporter=text-lcov | coveralls" }, "homepage": "https://github.com/deltachat/deltachat-node", "repository": { @@ -25,6 +26,8 @@ "xtend": "^4.0.1" }, "devDependencies": { + "coveralls": "^3.0.2", + "nyc": "^12.0.2", "standard": "^11.0.1", "tape": "^4.9.1", "tempy": "^0.2.1"