Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/456.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript grunt loop摩卡:警告:任务“;“摩卡咖啡”;没有找到。使用--force继续_Javascript_Node.js_Gruntjs_Mocha.js_Node Modules - Fatal编程技术网

Javascript grunt loop摩卡:警告:任务“;“摩卡咖啡”;没有找到。使用--force继续

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.

我正在使用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.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');