【发布时间】:2016-03-18 02:45:46
【问题描述】:
通过 grunt mochaTest 运行我的代码时,我收到了这个错误:
警告:找不到任务“mochaTest”。使用 --force 继续。
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']);
};
【问题讨论】: