Merge branch 'master' of github.com:gruntjs/grunt-contrib-jasmine

* 'master' of github.com:gruntjs/grunt-contrib-jasmine:
  Update npm on install.
  Option to allow specifying a junitTemplate
  Added jasmine favicon to default html runner template.
This commit is contained in:
vladikoff 2014-05-31 21:19:06 -07:00
commit e59768cd60
6 changed files with 7 additions and 3 deletions

View File

@ -3,4 +3,5 @@ node_js:
- "0.8" - "0.8"
- "0.10" - "0.10"
before_install: before_install:
- npm install -g grunt-cli - npm install -g npm
- npm install -g grunt-cli

View File

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

View File

@ -3,6 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Jasmine Spec Runner</title> <title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="<%= temp %>/jasmine_favicon.png">
<% css.forEach(function(style){ %> <% css.forEach(function(style){ %>
<link rel="stylesheet" type="text/css" href="<%= style %>"> <link rel="stylesheet" type="text/css" href="<%= style %>">
<% }) %> <% }) %>

View File

@ -53,7 +53,7 @@ exports.init = function(grunt, phantomjs) {
exports.copyTempFile(__dirname + '/../jasmine/reporters/PhantomReporter.js', 'reporter.js'); exports.copyTempFile(__dirname + '/../jasmine/reporters/PhantomReporter.js', 'reporter.js');
['jasmine.css', 'jasmine.js', 'jasmine-html.js', 'boot.js'].forEach(function(name){ ['jasmine.css', 'jasmine.js', 'jasmine-html.js', 'boot.js', 'jasmine_favicon.png'].forEach(function(name){
var path = __dirname + '/../../vendor/jasmine-' + options.version + '/' + name; var path = __dirname + '/../../vendor/jasmine-' + options.version + '/' + name;
if (fs.existsSync(path)) exports.copyTempFile(path, name); if (fs.existsSync(path)) exports.copyTempFile(path, name);
}); });

View File

@ -3,6 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Jasmine Spec Runner</title> <title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="path/to/temp/folder/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="css/a.css"> <link rel="stylesheet" type="text/css" href="css/a.css">

View File

@ -31,6 +31,7 @@ exports.jasmine = {
reporters : ['R1.js'], reporters : ['R1.js'],
boot : ['BOOT.js'] boot : ['BOOT.js']
}, },
temp: 'path/to/temp/folder',
options : {} options : {}
}; };