add coverage reporting using nyc and coveralls

This commit is contained in:
Benjamin Coe 2015-05-25 01:37:33 -07:00
parent e3272e8449
commit b630e70855
4 changed files with 10 additions and 1 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
node_modules
coverage
nyc_output

View file

@ -4,3 +4,4 @@ node_js:
- 'iojs'
- '0.12'
- '0.10'
after_success: npm run coveralls

View file

@ -13,7 +13,9 @@
},
"scripts": {
"test": "mocha",
"bench": "matcha benchmark.js"
"bench": "matcha benchmark.js",
"coverage": "nyc npm test && nyc report",
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
},
"files": [
"index.js"
@ -47,8 +49,10 @@
"supports-color": "^1.3.0"
},
"devDependencies": {
"coveralls": "^2.11.2",
"matcha": "^0.6.0",
"mocha": "*",
"nyc": "^2.1.4",
"require-uncached": "^1.0.2",
"resolve-from": "^1.0.0",
"semver": "^4.3.3"

View file

@ -8,6 +8,8 @@
> Terminal string styling done right
[![Build Status](https://travis-ci.org/sindresorhus/chalk.svg?branch=master)](https://travis-ci.org/sindresorhus/chalk) [![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)
[![Coverage Status](https://coveralls.io/repos/sindresorhus/chalk/badge.svg?branch=)](https://coveralls.io/r/sindresorhus/chalk?branch=)
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.