'use strict';

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        jshint: {
            allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
            options: {
                jshintrc: '.jshintrc',
            }
        },
        mochacli: {
            all: ['test/**/*.js'],
            options: {
                reporter: 'spec',
                ui: 'tdd'
            }
        }
    })

    // Load the plugins
    grunt.loadNpmTasks('grunt-contrib-jshint')
    grunt.loadNpmTasks('grunt-mocha-cli')

    // Configure tasks
    grunt.registerTask('default', ['test'])
    grunt.registerTask('test', ['mochacli', 'jshint'])
}

@@ -462,24 +462,746 @@
  %7D%0A        %7D
+,%0A        'mocha_istanbul': %7B%0A            coveralls: %7B%0A                src: %5B 'test/lib', 'test/lib/utils' %5D,%0A                options: %7B%0A                    coverage: true,%0A                    legend: true,%0A                    check: %7B%0A                        lines: 97,%0A                        statements: 98%0A                    %7D,%0A                    root: './lib',%0A                    reportFormats: %5B'lcov'%5D%0A                %7D%0A            %7D%0A        %7D%0A    %7D)%0A    %0A    grunt.event.on('coverage', function(lcov, done)%7B%0A        require('coveralls').handleInput(lcov, function(error) %7B%0A            if (error) %7B%0A                console.log(error)%0A                return done(error)%0A            %7D%0A            done()%0A        %7D)
 %0A    %7D)%0A%0A   
@@ -1309,16 +1309,63 @@
 ha-cli')
+%0A    grunt.loadNpmTasks('grunt-mocha-istanbul')
 %0A%0A    //
@@ -1381,16 +1381,82 @@
 e tasks%0A
+    grunt.registerTask('coveralls', %5B'mocha_istanbul:coveralls'%5D)%0A
     grun
@@ -1487,24 +1487,25 @@
 , %5B'test'%5D)%0A
+%0A
     grunt.re
@@ -1544,13 +1544,26 @@
 'jshint'
+, 'coveralls'
 %5D)%0A%7D%0A

Update grunt file to run coverage reports