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 
       } 
      } 
     } 
    } 
} 
相关问题