diff --git a/.travis.yml b/.travis.yml index 3574534..bcd044d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,3 +4,7 @@ node_js: - "6.1" - "5.11" - "iojs" +script: + - "npm run-script test-cov" +after_success: + - "npm run-script report-cov" diff --git a/README.md b/README.md index 5e63433..e2d458a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Algorithms with JavaScript [![Build Status](https://travis-ci.org/yefremov/algorithms-with-javascript.svg?branch=master)](https://travis-ci.org/yefremov/algorithms-with-javascript) + [![Coverage Status](https://coveralls.io/repos/github/yefremov/algorithms-with-javascript/badge.svg?branch=master)](https://coveralls.io/github/yefremov/algorithms-with-javascript?branch=master) This is a collection of different algorithms, written in JavaScript. The purpose of this library is to define basic algorithms in a concise, diff --git a/package.json b/package.json index 52bc3bb..6f3930a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "description": "Common programming algorithms written with JavaScript", "main": "index.js", "scripts": { - "test": "tape lib/**/*-test.js | tap-spec" + "test": "tape lib/**/*-test.js | tap-spec", + "test-cov": "nyc npm test", + "report-cov": "nyc report --reporter=text-lcov | coveralls" }, "repository": { "type": "git", @@ -17,6 +19,8 @@ }, "homepage": "https://github.com/yefremov/algorithms-with-javascript#readme", "devDependencies": { + "coveralls": "^2.11.15", + "nyc": "^10.1.2", "tap-spec": "^4.1.1", "tape": "^4.6.3" }