Javascript grunt loop摩卡:警告:任务“;“摩卡咖啡”;没有找到。使用--force继续
我正在使用grunt loop mocha节点模块。当我执行咕噜测试时,我得到以下错误:Javascript grunt loop摩卡:警告:任务“;“摩卡咖啡”;没有找到。使用--force继续,javascript,node.js,gruntjs,mocha.js,node-modules,Javascript,Node.js,Gruntjs,Mocha.js,Node Modules,我正在使用grunt loop mocha节点模块。当我执行咕噜测试时,我得到以下错误: Warning: Task "loopmocha" not found. Use --force to continue. Aborted due to warnings. 这是我的密码: module.exports = function(grunt) { require("grunt-loop-mocha") // Project configuration. grunt.
Warning: Task "loopmocha" not found. Use --force to continue.
Aborted due to warnings.
这是我的密码:
module.exports = function(grunt) {
require("grunt-loop-mocha")
// Project configuration.
grunt.initConfig({
loopmocha: {
src: ["./tests/***-specs.js"],
options: {
mocha: {
parallel: true,
globals: ['should'],
timeout: 3000,
ui: 'bdd',
reporter: "xunit-file"
},
loop: {
reportLocation: "test/report"
},
env1: {
stringVal: "fromfile"
},
env2: {
jsonVal: {
foo: {
bar: {
stringVal: "baz"
}
}
}
},
iterations: [
{
"description": "first",
"env1": {
"someKey": "some value"
}
},
{
"description": "second",
"env2": {
"someOtherKey": "some other value"
}
},
{
"description": "third",
"mocha": {
"timeout": 4000
}
},
{
"description": "fifth",
"env1": {
"anotherKey": "BLERG"
},
"env2": {
"yetAnotherKey": 123
}
}
]
}
}
});
grunt.registerTask('test', 'loopmocha');
};
我甚至还安装了npm I grunt loop摩卡
不知道少了什么。基本上,我正在尝试使用grunt loop mocha在不同的浏览器中执行测试 我通过将grunt loop mocha作为NPM任务加载来解决这个问题
grunt.loadNpmTasks('grunt-loop-mocha');