2017-07-14 54 views
0

我正在使用grunt-loop-mocha節點模塊。當我執行咕嚕測試,我得到以下錯誤:grunt-loop-mocha:警告:找不到任務「loopmocha」。使用--force繼續

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我咕嚕 - 環 - 摩卡

不知道缺少什麼。基本上,我正嘗試使用grunt-loop-mocha在不同的瀏覽器中執行測試。

回答

相關問題