Skip to content

Commit

Permalink
Merge pull request #21 from lloydwatkin/coverage
Browse files Browse the repository at this point in the history
Add coverage reports
  • Loading branch information
lloydwatkin committed Dec 23, 2014
2 parents 8d1274f + 066bffb commit 42ce53f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
config.js
coverage
npm-debug.log
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ before_install:
# https://github.com/travis-ci/travis-cookbooks/issues/155
- sudo rm -rf /dev/shm
- sudo ln -s /run/shm /dev/shm
before_script:
- npm install -g grunt-cli
language: node_js
node_js:
- "0.11"
29 changes: 28 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,41 @@ module.exports = function(grunt) {
reporter: 'spec',
ui: 'tdd'
}
},
'mocha_istanbul': {
coveralls: {
src: 'test/lib',
options: {
coverage: true,
legend: true,
check: {
lines: 97,
statements: 96
},
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.registerTask('coveralls', ['mocha_istanbul:coveralls'])
// Configure tasks
grunt.registerTask('default', ['test'])
grunt.registerTask('test', ['mochacli', 'jshint'])
grunt.loadNpmTasks('grunt-mocha-istanbul')
grunt.registerTask('test', ['mochacli', 'jshint', 'coveralls'])
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
xmpp-command-bot
==================

__Note: Not currently working, development in progress.__

An XMPP bot which takes messages from a chat room or a prescribed set of users and runs commands on the local server.

Build status: [![Build Status](https://travis-ci.org/lloydwatkin/xmpp-command-bot.svg?branch=master)](https://travis-ci.org/lloydwatkin/xmpp-command-bot)
[![Coverage Status](https://img.shields.io/coveralls/lloydwatkin/xmpp-command-bot.svg)](https://coveralls.io/r/lloydwatkin/xmpp-command-bot)
[![Dependency Status](https://david-dm.org/lloydwatkin/xmpp-command-bot.svg?style=flat)](https://david-dm.org/lloydwatkin/xmpp-command-bot)
[![devDependency Status](https://david-dm.org/lloydwatkin/xmpp-command-bot/dev-status.svg?style=flat)](https://david-dm.org/lloydwatkin/xmpp-command-bot#info=devDependencies)
[![Donate to help support development](http://img.shields.io/gratipay/_lloydwatkin.svg?style=flat)](https://www.gittip.com/lloydwatkin/)
Expand Down
2 changes: 1 addition & 1 deletion lib/commander.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Commander.prototype.handle = function(command, callback) {
if (stderr) return callback(
self.ERROR + stderr.toString()
)
var output = (!self.config[self.command].reply) ? self.SUCCESS : stdout.toString()
var output = (!config.reply) ? self.SUCCESS : stdout.toString()
callback(output)
})
}
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "An XMPP chat bot for running local commands",
"main": "index.js",
"scripts": {
"test": "NODE_ENV=testing grunt test"
"test": "NODE_ENV=testing ./node_modules/.bin/grunt test"
},
"repository": {
"type": "git",
Expand All @@ -27,11 +27,17 @@
"debug": "^1.0.4"
},
"devDependencies": {
"coveralls": "^2.11.2",
"node-xmpp-server": "^1.0.0-alpha11",
"mocha": "^1.20.1",
"grunt": "^0.4.5",
"grunt-mocha-cli": "^1.9.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-jshint": "^0.10.0",
"grunt-mocha-cli": "^1.9.0",
"grunt-mocha-istanbul": "^2.2.0",
"istanbul": "^0.3.5",
"mocha": "^1.20.1",
"node-xmpp-server": "^1.0.0-alpha3",
"proxyquire": "^1.0.1",
"should": "^4.0.4"
}
Expand Down

0 comments on commit 42ce53f

Please sign in to comment.