Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code coverage report #49

Merged
merged 6 commits into from
Dec 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ examples/public/google*
*.geany
*~
*.swp
coverage
32 changes: 30 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: 98,
statements: 97
},
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'])
}
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand All @@ -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")

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down