all files / qlobber/ Gruntfile.js

100% Statements 16/16
100% Branches 0/0
100% Functions 1/1
100% Lines 16/16
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75                                                                                                                     
/*jslint node: true */
"use strict";
 
module.exports = function (grunt)
{
    grunt.initConfig(
    {
        jshint: {
            all: [ 'Gruntfile.js', 'index.js', 'lib/*.js', 'test/*.js', 'bench/**/*.js' ],
            options: {
                esversion: 6
            }
        },
 
        mochaTest: {
            src: 'test/*.js'
        },
 
        apidox: {
            input: 'lib/qlobber.js',
            output: 'README.md',
            fullSourceDescription: true,
            extraHeadingLevels: 1
        },
 
        shell: {
            cover: {
                command: './node_modules/.bin/istanbul cover ./node_modules/.bin/grunt -- test'
            },
 
            check_cover: {
                command: './node_modules/.bin/istanbul check-coverage --statement 100 --branch 100 --function 100 --line 100'
            },
 
            coveralls: {
                command: 'cat coverage/lcov.info | coveralls'
            },
 
            bench: {
                command: './node_modules/.bin/bench -c 20000 -i bench/options/default.js,bench/options/dedup.js -k options bench/add_match_remove bench/match'
            },
 
            'bench-check': {
                command: './node_modules/.bin/bench -c 20000 -i bench/options/check.js,bench/options/check-dedup.js -k options bench/add_match_remove bench/match'
            },
 
            'bench-add-many': {
                command: './node_modules/.bin/bench -c 1 -i bench/options/default.js,bench/options/dedup.js -k options bench/add_many.js'
            },
 
            'bench-match-many': {
                command: './node_modules/.bin/bench -c 1 -i bench/options/default.js,bench/options/dedup.js -k options bench/match_many.js'
            }
        }
    });
    
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-mocha-test');
    grunt.loadNpmTasks('grunt-apidox');
    grunt.loadNpmTasks('grunt-shell');
 
    grunt.registerTask('lint', 'jshint');
    grunt.registerTask('test', 'mochaTest');
    grunt.registerTask('docs', 'apidox');
    grunt.registerTask('coverage', ['shell:cover', 'shell:check_cover']);
    grunt.registerTask('coveralls', 'exec:coveralls');
    grunt.registerTask('bench', ['exec:bench',
                                 'exec:bench-add-many',
                                 'exec:bench-match-many']);
    grunt.registerTask('bench-check', 'exec:bench-check');
    grunt.registerTask('bench-add-many', 'exec:bench-add-many');
    grunt.registerTask('bench-match-many', 'exec:bench-match-many');
    grunt.registerTask('default', ['jshint', 'mochaTest']);
};