Thursday, October 3, 2013

mystery requirement for require

The require thing won't just work out of the box in GRUNT. There is a dependency you need, but I'm not sure what it is. This works however:

module.exports = function(grunt) {
   grunt.initConfig({
      pkg: '<json:package.json>',
      build: {
         dest: 'dist'
      },
      mocha: {
         test: {
            src: ['test.html'],
            options: {
               log: true,
               reporter: 'Dot',
               run: false
            }
         }
      }
   });
   grunt.loadNpmTasks('grunt-mocha');
   grunt.registerTask('default', ['mocha']);
   grunt.registerTask('test', 'mocha');
   grunt.registerTask('tagger', function() {
      var tagger = require('./testy');
   });
   grunt.registerTask('hudson-ci', ['tagger', 'test']);
};

 
 

...so if you reference mocha, that will carry along whatever the underlying requirement is for line of code above reaching out to testy.js. I don't know what it is yet.

No comments:

Post a Comment