Coverage.json not generated with Jasmine RequireJS and Istanbul in grunt

Viewed 307

I have trying to generate coverage report based from grunt using grunt-template-jasmine-istanbul. The Specs are executed correctly but no coverage report is generated.

Below is my code in the config file:

var name = 'SuperAccounts';
//*** Configure grunt
console.log(jasmine);
grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: jshint,
    durandal: durandal,
    jasmine: {
        coverage : {

            src: [
               '../../../Test.UnitTest.JS/UnitTests/' + name + '/**/*.js'
            ],
            options: {
                template: require('grunt-template-jasmine-istanbul'),
                specs: [
                        //'../Test.UnitTest.JS/UnitTests/' + name + '/common/*.js',
                        //'../Test.UnitTest.JS/UnitTests/' + name + '/testdata',
                        '../Test.UnitTest.JS/UnitTests/' + name + '/**/*.js'
                ],
                helpers: [
                        'Assets/scripts/ato/helperscript.js'

                        //'Legacy/Shared/common/constants.js'
                ],
                vendor: jasmine.SuperAccounts,
                templateOptions: {
                    //files: 'src/assets/js/app/**/*.js',
                    coverage: 'bin/coverage/coverage.json',
                    report: 'bin/coverage',
                    thresholds: {
                        lines: 75,
                        statements: 75,
                        branches: 75,
                        functions: 90
                    },
                    replace: false,
                    template: require('grunt-template-jasmine-requirejs'),
                    templateOptions: {
                        requireConfig: {
                            baseUrl: 'SinglePageApplications/' + name,
                            //waitSeconds: 30,
                            paths: mixIn({
                                'knockout-editables': '../../Assets/scripts/vendor/ko.editables-0.9.0',
                                'knockout-validation': '../../Assets/scripts/vendor/knockout.validation-1.0.2',
                                'bignumber': '../../Assets/scripts/vendor/bignumber-1.4.1',
                                'testutils': '../../../Test.UnitTest.JS/Utils',
                                'shared': '../../Legacy/Shared',
                                'testdata': '../../../Test.UnitTest.JS/UnitTests/' + name + '/testdata'
                            }, addConfigurationPaths(config.SuperAccounts))

                        }
                    },
                    helpers: [
                        'Assets/scripts/ato/helperscript.js'

                        //'Legacy/Shared/common/constants.js'
                    ],
                    specs: [
                        //'../Test.UnitTest.JS/UnitTests/' + name + '/common/*.js',
                        //'../Test.UnitTest.JS/UnitTests/' + name + '/testdata',
                        '../Test.UnitTest.JS/UnitTests/' + name + '/**/*.js'
                    ],
                    //junit: {
                    //    path: 'build/junit/' + name + '/'
                    //},
                    timeout: 100000,
                    vendor: jasmine.SuperAccounts
                }
            }
            ,
            //specs : 'src/test/js/unit-headless.html',

            phantomjs: {
                'ignore-ssl-errors': true
            },


        }

    },
    uglify: uglify,
    cssmin: cssmin,
    autoprefixer: {
        options: {
            diff: true,
            map: true,
            browsers: ['last 2 versions', 'ie 8', 'ie 9']
        },
        multiple_files: {
            expand: true,
            flatten: true,
            src: 'ui/styles/ato/**/*.css',
            dest: 'ui/styles/ato/autoprefix'
        },
    },
    compress: {
        main: {
            options: {
                archive: staticsZip,
                level: 9
            },
            files: [
                { src: ['ui/**'], dest: '/', filter: 'isFile' }
            ]
    }
    }
});

//*** Loading plugins
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-durandal');
grunt.loadNpmTasks('grunt-contrib-jasmine');
1 Answers
Related