Code coverage report for recursive-object-mask/gruntfile.coffee

Statements: 0% (0 / 17)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 0% (0 / 16)      Ignored: none     

All files » recursive-object-mask/ » gruntfile.coffee
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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162                                                                                                                                                                                                                                                                                                                                   
###
Licensed under the MIT license
For full copyright and license information, please see the LICENSE file
 
@author     Bryan Conrad <bkconrad@gmail.com>
@copyright  2015 Bryan Conrad
@link       https://github.com/kaen/node-nested-object-mask
@license    http://choosealicense.com/licenses/MIT  MIT License
###
 
module.exports = ( grunt ) ->
 
  ### ALIASES ###
 
  jsonFile =                      grunt.file.readJSON           # Read a json file
  define =                        grunt.registerTask            # Register a local task
  log =                           grunt.log.writeln             # Write a single line to STDOUT
 
 
  ### GRUNT CONFIGURATION ###
 
  config =
 
    # Define aliases for known fs locations
    srcDir:                       'src/'              # CoffeeScript or other source files to be compiled or processed
    libDir:                       'lib/'              # JavaScript or other compiled files to be included in the package
    tstDir:                       'test/'             # Project's tests
    resDir:                       'res/'              # Static resources - images, text files, external deps etc.
    docDir:                       'docs/'             # Automatically-generated or compiled documentation
    srcFiles:                     ['<%= srcDir %>**/*.coffee', 'index.coffee']
    tstFiles:                     '<%= tstDir %>**/*.test.coffee'
    pkg:                          jsonFile 'package.json'
 
 
    ### TASKS DEFINITION ###
 
    # grunt-contrib-watch: Run tasks on filesystem changes
    watch:
      options:
        # Define default tasks here, then point targets' "tasks" attribute here: '<%= watch.options.tasks %>'
        tasks:                    ['lint', 'cov']    # Run these tasks when a change is detected
        interrupt:                true                # Restarts any running tasks on next event
        atBegin:                  true                # Runs all defined watch tasks on startup
        dateFormat:               ( time ) -> log "Done in #{time}ms"
 
      # Targets
 
      gruntfile:                  # Watch the gruntfile for changes ( also dynamically reloads grunt-watch config )
        files:                    'gruntfile.coffee'
        tasks:                    '<%= watch.options.tasks %>'
 
      project:                    # Watch the project's source files for changes
        files:                    ['<%= srcFiles %>', '<%= tstFiles %>']
        tasks:                    '<%= watch.options.tasks %>'
 
 
    # grunt-coffeelint: Lint CoffeeScript files
    coffeelint:
      options:                    jsonFile 'coffeelint.json'
 
      # Targets
 
      gruntfile:                  'gruntfile.coffee'                          # Lint this file
      project:                    ['<%= srcFiles %>', '<%= tstFiles %>']      # Lint application's project files
 
 
    # grunt-mocha-cli: Run tests with Mocha framework
    mochacli:
      options:
        reporter:                 'spec'                                      # This report is nice and human-readable
        compilers:                ['coffee:coffee-script/register']
        excludes:                 './gruntfile.coffee'
 
      # Targets
 
      project:                    # Run the project's tests
        src:                      ['<%= tstFiles %>']
 
    # grunt-mocha-istanbul: Run tests with coverage report
    mocha_istanbul:
      coverage:
        src: 'test'
        options:
          mochaOptions: ['--compilers', 'coffee:coffee-script/register']
 
      options:
        root: 'src'
        require:                  ['coffee-coverage/register-istanbul']
 
    # grunt-codo: CoffeeScript API documentation generator
    codo:
      options:
        title:                    'nested-object-mask'
        debug:                    false
        inputs:                   ['<%= srcDir %>']
        output:                   '<%= docDir %>'
 
 
    # grunt-contrib-coffee: Compile CoffeeScript into native JavaScript
    coffee:
 
      # Targets
 
      build:                      # Compile CoffeeScript into target build directory
        expand:                   true
        ext:                      '.js'
        src:                      '<%= srcFiles %>'
        dest:                     '<%= libDir %>'
 
 
    # grunt-contrib-uglify: Compress and mangle JavaScript files
    uglify:
 
      # Targets
 
      build:
        files: [
          expand:                 true
          src:                    '<%= srcDir %>**/*.js'
        ]
 
 
    # grunt-contrib-clean: Clean the target files & folders, deleting anything inside
    clean:
 
      # Targets
 
      build:                      ['<%= srcDir %>**/*.js', 'index.js']        # Clean the build products
      docs:                       ['<%= docDir %>']
 
    # grunt-gh-pages: Build GH pages
    'gh-pages':
      options:
        base: '.'
 
      src: ['docs/**', 'coverage/**']
 
 
  ###############################################################################
 
  ### CUSTOM FUNCTIONS ###
 
 
  ### GRUNT MODULES ###
 
  # Loads all grunt tasks from devDependencies starting with "grunt-"
  require( 'load-grunt-tasks' )( grunt )
 
  ### GRUNT TASKS ###
 
  define 'lint',                  ['coffeelint']
  define 'test',                  ['mochacli']
  define 'cov',                   ['mocha_istanbul']
  define 'docs',                  ['codo']
  define 'build:dev',             ['clean:build', 'lint', 'test', 'coffee:build']
  define 'build',                 ['build:dev', 'uglify:build']
  define 'pages',                 ['build', 'cov', 'docs', 'gh-pages']
  define 'default',               ['build']
 
  ###############################################################################
  grunt.initConfig config