From ba67771db936b1165c60e37085f6f8579e6bafc6 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Thu, 28 May 2015 23:33:55 -0700 Subject: [PATCH] adds coverage reporting with nyc and coveralls --- .gitignore | 2 ++ .travis.yml | 2 ++ README.md | 1 + package.json | 51 +++++++++++++++++++++++++++++---------------------- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 93bcbfd7..69b51c5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.swp node_modules npm-debug.log +.nyc_output +coverage diff --git a/.travis.yml b/.travis.yml index 7d07e605..7936cc99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,3 +4,5 @@ node_js: - "0.10" - "0.12" - iojs + +after_success: npm run coveralls diff --git a/README.md b/README.md index 9e0242e4..4c586c15 100644 --- a/README.md +++ b/README.md @@ -360,6 +360,7 @@ Running tests, development ========================== [![Build Status](https://secure.travis-ci.org/Leonidas-from-XIV/node-xml2js.png?branch=master)](https://travis-ci.org/Leonidas-from-XIV/node-xml2js) +[![Coverage Status](https://coveralls.io/repos/Leonidas-from-XIV/node-xml2js/badge.svg?branch=)](https://coveralls.io/r/Leonidas-from-XIV/node-xml2js?branch=master) [![Dependency Status](https://david-dm.org/Leonidas-from-XIV/node-xml2js.png)](https://david-dm.org/Leonidas-from-XIV/node-xml2js) The development requirements are handled by npm, you just need to install them. diff --git a/package.json b/package.json index f84902ad..08ac202e 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,14 @@ { - "name" : "xml2js", - "description" : "Simple XML to JavaScript object converter.", - "keywords" : ["xml", "json"], - "homepage" : "https://github.com/Leonidas-from-XIV/node-xml2js", - "version" : "0.4.8", - "author" : "Marek Kubica (http://xivilization.net)", - "contributors" : [ + "name": "xml2js", + "description": "Simple XML to JavaScript object converter.", + "keywords": [ + "xml", + "json" + ], + "homepage": "https://github.com/Leonidas-from-XIV/node-xml2js", + "version": "0.4.8", + "author": "Marek Kubica (http://xivilization.net)", + "contributors": [ "maqr (https://github.com/maqr)", "Ben Weaver (http://benweaver.com/)", "Jae Kwon (https://github.com/jaekwon)", @@ -41,26 +44,30 @@ "Ryan Gahl (https://github.com/ryedin)", "Eric Laberge (https://github.com/elaberge)" ], - "main" : "./lib/xml2js", - "directories" : { + "main": "./lib/xml2js", + "directories": { "lib": "./lib" }, - "scripts" : { - "test": "zap" + "scripts": { + "test": "zap", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" }, - "repository" : { - "type" : "git", - "url" : "https://github.com/Leonidas-from-XIV/node-xml2js.git" + "repository": { + "type": "git", + "url": "https://github.com/Leonidas-from-XIV/node-xml2js.git" }, - "dependencies" : { - "sax" : "0.6.x", - "xmlbuilder" : ">=2.4.6" + "dependencies": { + "sax": "0.6.x", + "xmlbuilder": ">=2.4.6" }, - "devDependencies" : { - "coffee-script" : ">=1.9.0", - "zap" : ">=0.2.6", - "docco" : ">=0.6.2", - "diff" : ">=1.0.8" + "devDependencies": { + "coffee-script": ">=1.9.0", + "coveralls": "^2.11.2", + "diff": ">=1.0.8", + "docco": ">=0.6.2", + "nyc": "^2.2.1", + "zap": ">=0.2.6" }, "license": "MIT" }