咕噜模板茉莉花伊斯坦布尔没有生成报道报道

时间:2015-12-21 02:45:42

标签: javascript gruntjs istanbul grunt-contrib-requirejs grunt-contrib-jasmine

我正在使用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 个答案:

答案 0 :(得分: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
                }
            }
        }
    }
}
相关问题