I am getting below error while executing mocha tests through Grunt
My grunt file:
// Gruntfile.js
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Mocha
mocha: {
all: {
src: ['./tests/**/*-specs.js'],
},
options: {
run: true
}
}
});
// Load grunt mocha task
grunt.loadNpmTasks('mocha');
grunt.registerTask('default', ['mocha']);
};
When I run command grunt, I get below exception:
>> Local Npm module "mocha" not found. Is it installed?
Warning: Task "mocha" not found. Use --force to continue.
Aborted due to warnings.