Option to allow specifying a junitTemplate

Allow for a customized junitTemplate using options.junit.template.
This commit is contained in:
Chris O. 2014-05-19 22:43:40 -07:00
parent f28ced0bea
commit 238aad2e06

View File

@ -360,7 +360,7 @@ module.exports = function(grunt) {
}
function writeJunitXml(testsuites){
var template = grunt.file.read(junitTemplate);
var template = grunt.file.read(options.junit.template || junitTemplate);
if (options.junit.consolidate) {
var xmlFile = path.join(options.junit.path, 'TEST-' + testsuites.suite1.name.replace(/[^\w]/g, '') + '.xml');
grunt.file.write(xmlFile, grunt.util._.template(template, { testsuites: _.values(testsuites)}));