all files / restify-curd/ Gruntfile.coffee

0% Statements 0/14
0% Branches 0/6
0% Functions 0/2
0% Lines 0/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25                                                 
module.exports = (grunt)->
    pkg = grunt.file.readJSON 'package.json'
 
    grunt.initConfig
        shell:
            mocha:
                command:'mocha --compilers coffee:coffee-script/register -b'
        coffee:
            dev:
                src:['coffee/*.coffee']
                dest:'lib/'
                ext:'.js'
                expand:true
                flatten:true
 
    grunt.loadNpmTasks 'grunt-shell'
    grunt.loadNpmTasks 'grunt-contrib-coffee'
 
    grunt.registerTask 'test','mocha tests.',(arg1,arg2)->
        fileName = arg1
        fileName += '.coffee' if not /\.coffee$/.test fileName
        fileName = 'test/'+fileName if not /^test\//.test fileName
        grunt.config ['shell','mocha','command'],'mocha --compilers coffee:coffee-script/register -w ' + fileName + ' -b' if arg1
        grunt.task.run 'shell:mocha'