gruntjs - Grunt-template-jasmine-istanbul missing dir error -
i install grunt plugins grunt-template-jasmine-istanbul
npm install grunt-template-jasmine-istanbul --save-dev
and add gruntfile.js following:
coverage: { src: ['app/scripts/**/*.js'], options: { specs: ['test/**/*.js'], template: require('grunt-template-jasmine-istanbul'), templateoptions: { coverage: 'test/coverage/coverage.json', report: [ {type:'html',options: {dir: 'test/coverage/html'}}, {type:'text',options: {dir: 'test/coverage/text'}}, {type:'text'}, ], thresholds: { lines: 75, statements: 75, branches: 75, functions: 90 } } } },
but when running test shown following warning , no report in test/coverage folder:
my@computer:/share/angularjs-gs$ grunt test:coverage running "coverage" task warning: "dir" option required. use --force continue. aborted due warnings.
i've created test/coverage/html , test/converage/text folder. view code plugin's author cannot find solution: https://github.com/maenu/grunt-template-jasmine-istanbul-example/blob/connect/gruntfile.js
i've found it, must wrap coverage object jasmine, maybe coverage used jasmine plugin spec , src attribute seems being redundant.
jasmine: { coverage: { src: ['app/scripts/**/*.js'], options: { specs: ['test/**/*.js'], template: require('grunt-template-jasmine-istanbul'), templateoptions: { coverage: 'test/coverage/coverage.json', report: [ {type:'html',options: {dir: 'test/coverage/html'}}, {type:'text',options: {dir: 'test/coverage/text/'}}, {type:'text-summary'} ], thresholds: { lines: 75, statements: 75, branches: 75, functions: 90 } } }
Comments
Post a Comment