2016-03-17 32 views
0

虽然通过咕噜mochaTest我收到此错误运行我的代码:警告:任务 “mochatest” 找不到

Warning: Task "mochaTest" not found. Use --force to continue.

module.exports = function(grunt) { 
    grunt.loadTasks('grunt-mocha-test'); 
    grunt.loadTasks('grunt-contrib-watch'); 
    grunt.initConfig({ 
     mochaTest: { 
      test: { 
       options: { 
        reporter: 'spec', 
        clearRequireCache: true 
       }, 
       src: ['test/**/*.js'] 
      }, 
     }, 
     watch: { 
      scripts: { 
       files: ['**/*.js'], 
       tasks: ['mochaTest'] 
      } 
     } 
    }); 
    grunt.registerTask('test', ['mochaTest']); 
}; 

回答

0

变化grunt.loadTasksgrunt.loadNpmTasks

这应该可以解决您的错误。

有关更多信息,请参见Grunt docs

+0

谢谢......现在它正在工作..很愚蠢的怀疑。 –

相关问题