diff --git a/README.md b/README.md index b3a26ce..b317d51 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,10 @@ This object is `JSON.stringify()`-ed ( **support serialize Function object** ) i If `requireConfigFile` is specified then it will be loaded first and the settings specified by this directive will be deep-merged onto those. +### templateOptions.specRunnerTemplate +Type: `String` + +If you wish to override the template version of the SpecRunner.html that is built out (for customizing), then you can provide the path for this. If you wish to alter the template, you can create a copy from [here](https://github.com/cloudchen/grunt-template-jasmine-requirejs/blob/master/src/templates/jasmine-requirejs.html). If `specRunnerTemplate` is provided and the file exists, it uses this file, otherwise it falls back to the default built in template. ## Sample usage diff --git a/src/template-jasmine-requirejs.js b/src/template-jasmine-requirejs.js index 3b72f46..8767013 100644 --- a/src/template-jasmine-requirejs.js +++ b/src/template-jasmine-requirejs.js @@ -171,7 +171,9 @@ exports.process = function(grunt, task, context) { // update relative path of .grunt folder to the location of spec runner context.temp = path.relative(path.dirname(context.outfile), context.temp); - + if (context.options.specRunnerTemplate && grunt.file.exists(context.options.specRunnerTemplate)) { + template = context.options.specRunnerTemplate; + } var source = grunt.file.read(template); return grunt.util._.template(source, context); };