From 828e3f083acd97feea4ab9fb8f9eb96cd77c5e76 Mon Sep 17 00:00:00 2001 From: Lloyd Watkin Date: Mon, 1 Dec 2014 10:16:05 +0000 Subject: [PATCH 1/6] Ignore coverage folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6349ee8..5a5f5f1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ examples/public/google* *.geany *~ *.swp +coverage From 4ee0f79e135c36131d29130ed8162d5cc9e542e9 Mon Sep 17 00:00:00 2001 From: Lloyd Watkin Date: Mon, 1 Dec 2014 10:16:17 +0000 Subject: [PATCH 2/6] Remove bitdeli badge --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 093f815..0880b8f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,3 @@ npm i --save xmpp-ftw-muc ``` npm test ``` - - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/xmpp-ftw/xmpp-ftw-muc/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - From a6ab2bd0e78d9823b8e3e76fb44d1f7e35d6e919 Mon Sep 17 00:00:00 2001 From: Lloyd Watkin Date: Mon, 1 Dec 2014 10:16:40 +0000 Subject: [PATCH 3/6] Install required coverage dependencies --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 9c2c947..793f1f1 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,9 @@ "ltx": "0.x" }, "devDependencies": { + "coveralls": "^2.11.2", + "grunt-mocha-istanbul": "^2.2.0", + "istanbul": "^0.3.2", "mocha": "~1.8.1", "should": "~1.2.2", "xmpp-ftw": "1.x", From a02812721e2c79bf9153830e55468b57562ea3f7 Mon Sep 17 00:00:00 2001 From: Lloyd Watkin Date: Mon, 1 Dec 2014 10:16:55 +0000 Subject: [PATCH 4/6] Update grunt file to perform coverage task --- Gruntfile.js | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d7e2c9f..98c2a5e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -16,14 +16,42 @@ module.exports = function(grunt) { reporter: 'spec', ui: 'tdd' } + }, + 'mocha_istanbul': { + coveralls: { + src: [ 'test/lib', 'test/lib/utils' ], + options: { + coverage: true, + legend: true, + check: { + lines: 100, + statements: 99 + }, + root: './lib', + reportFormats: ['lcov'] + } + } } }) + + grunt.event.on('coverage', function(lcov, done){ + require('coveralls').handleInput(lcov, function(error) { + if (error) { + console.log(error) + return done(error) + } + done() + }) + }) // Load the plugins grunt.loadNpmTasks('grunt-contrib-jshint') grunt.loadNpmTasks('grunt-mocha-cli') + grunt.loadNpmTasks('grunt-mocha-istanbul') // Configure tasks + grunt.registerTask('coveralls', ['mocha_istanbul:coveralls']) grunt.registerTask('default', ['test']) - grunt.registerTask('test', ['mochacli', 'jshint']) -} + + grunt.registerTask('test', ['mochacli', 'jshint', 'coveralls']) +} \ No newline at end of file From 3bddf8ec8fd76f3bbac2c22b6fb7faa1b4860f70 Mon Sep 17 00:00:00 2001 From: Lloyd Watkin Date: Mon, 1 Dec 2014 10:17:06 +0000 Subject: [PATCH 5/6] Add coveralls.io badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0880b8f..1583b02 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ See the XMPP-FTW demo repository - https://github.com/xmpp-ftw/xmpp-ftw-demo # Build status [![Build Status](https://secure.travis-ci.org/xmpp-ftw/xmpp-ftw-muc.png)](http://travis-ci.org/xmpp-ftw/xmpp-ftw-muc) - +[![Coverage Status](https://img.shields.io/coveralls/xmpp-ftw/xmpp-ftw-muc.svg)](https://coveralls.io/r/xmpp-ftw/xmpp-ftw-muc) # Install ``` From 57f9195a99bc0d46673ac9b3e44b5b94be037f62 Mon Sep 17 00:00:00 2001 From: Lloyd Watkin Date: Mon, 1 Dec 2014 10:18:17 +0000 Subject: [PATCH 6/6] Reduce required numbers to match current coverage --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 98c2a5e..17b2f0b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -24,8 +24,8 @@ module.exports = function(grunt) { coverage: true, legend: true, check: { - lines: 100, - statements: 99 + lines: 98, + statements: 97 }, root: './lib', reportFormats: ['lcov']