4

即時通訊使用grunt-template-jasmine-istanbul和grunt-template-jasmine-requirejs。當我運行測試覆蓋率模塊時,所有測試用例都運行成功,但沒有生成覆蓋。咕嚕模板茉莉花伊斯坦布爾不生成覆蓋率報告

jasmine: { 
      coverage: { 
      src: [...], 
      options: { 
       specs: '...', 
       vendors: [...], 
       template: require('grunt-template-jasmine-istanbul'), 
       templateOptions: { 
        coverage: 'bin/coverage/coverage.json', 
        report: 'bin/coverage', 
        template: require('grunt-template-jasmine-requirejs'), 
        templateOptions: { 
         requireConfig: { 
          baseUrl: '...', 
         } 
        } 
       } 
      } 
      } 
     } 

回答

1

我們在我們的設置中遇到了確切的問題..問題僅僅是因爲src路徑中的路徑不正確。因此,請確保您已正確配置您的路徑。

下面是爲我們工作的示例代碼。問題應該完全在您的源路徑配置中。

jasmine : { 
    coverage : { 
     src : [ 
     'web/js/sad/service/common/model/**/*.js' ], 
     options : { 
      specs : [ 'tests/**/*.js' ], 
      template : require('grunt-template-jasmine-istanbul'), 
      vendor : [ '../3rdParty/extjs-4.1.0/*.js', 
        'web/js/common/controller/**/*.js' ], 
      templateOptions : { 
       coverage : 'bin/coverage/coverage.json', 
       report : 'bin/coverage', 
       thresholds : { 
        lines : 5, 
        statements : 5, 
        branches : 1, 
        functions : 1 
       } 
      } 
     } 
    } 
} 
相關問題