jasmine-growl-reporter
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -5,3 +5,4 @@ | ||
deps = deps || {}; | ||
var growl = deps.growl || require('growl'); | ||
var growl = deps.growl || require('growl'), | ||
path = require('path'); | ||
@@ -33,3 +34,4 @@ var GrowlReporter = function() { | ||
name: growlName, | ||
title: growlTitle(this.passedSpecs, this.totalSpecs, this.startedAt) | ||
title: growlTitle(this.passedSpecs, this.totalSpecs, this.startedAt), | ||
image: growlImage(this.passedSpecs, this.totalSpecs) | ||
}); | ||
@@ -39,7 +41,8 @@ } | ||
var growlName = 'Jasmine'; | ||
var growlName = 'Jasmine', | ||
resDir = path.resolve(__dirname, '../res'); | ||
var growlTitle = function(passedSpecs, totalSpecs, startedAt) { | ||
var title = passedSpecs < totalSpecs ? 'FAILED' : 'PASSED'; | ||
var title = passed(passedSpecs, totalSpecs) ? 'PASSED' : 'FAILED'; | ||
title += ' in ' + ((new Date().getTime() - startedAt.getTime()) / 1000) + 's'; | ||
@@ -64,3 +67,15 @@ | ||
var growlImage = function(passedSpecs, totalSpecs) { | ||
if (passed(passedSpecs, totalSpecs)) { | ||
return path.join(resDir, 'passed.png'); | ||
} else { | ||
return path.join(resDir, 'failed.png'); | ||
} | ||
}; | ||
var passed = function(passedSpecs, totalSpecs) { | ||
return passedSpecs == totalSpecs; | ||
}; | ||
return GrowlReporter; | ||
}; |
{ | ||
"name": "jasmine-growl-reporter", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "./index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
# Jasmine Growl Reporter | ||
[![NPM version](https://badge.fury.io/js/jasmine-growl-reporter.png)](http://badge.fury.io/js/jasmine-growl-reporter) | ||
[![Dependency Status](https://gemnasium.com/AlphaHydrae/jasmine-growl-reporter.png)](https://gemnasium.com/AlphaHydrae/jasmine-growl-reporter) | ||
[![Build Status](https://secure.travis-ci.org/AlphaHydrae/jasmine-growl-reporter.png)](http://travis-ci.org/AlphaHydrae/jasmine-growl-reporter) | ||
Growl notifications when running your Jasmine specs. | ||
@@ -13,1 +9,2 @@ | ||
* **License:** MIT (see [LICENSE.txt](https://raw.github.com/AlphaHydrae/jasmine-growl-reporter/master/LICENSE.txt)) | ||
* **Icons:** http://www.visualpharm.com/must_have_icon_set/ |
@@ -8,2 +8,3 @@ | ||
var injector = require('../lib/reporter').inject, | ||
path = require('path'), | ||
growl = null, | ||
@@ -26,3 +27,5 @@ reporter = null; | ||
passedRegexp = /^PASSED in [\d\.]+s$/, | ||
failedRegexp = /^FAILED in [\d\.]+s$/; | ||
failedRegexp = /^FAILED in [\d\.]+s$/, | ||
passedImage = path.resolve(__dirname, '../res/passed.png'), | ||
failedImage = path.resolve(__dirname, '../res/failed.png'); | ||
@@ -39,3 +42,4 @@ beforeEach(function() { | ||
name: title, | ||
title: passedRegexp | ||
title: passedRegexp, | ||
image: passedImage | ||
}); | ||
@@ -53,3 +57,4 @@ }); | ||
name: title, | ||
title: passedRegexp | ||
title: passedRegexp, | ||
image: passedImage | ||
}); | ||
@@ -67,3 +72,4 @@ }); | ||
name: title, | ||
title: failedRegexp | ||
title: failedRegexp, | ||
image: failedImage | ||
}); | ||
@@ -85,5 +91,6 @@ }); | ||
name: title, | ||
title: failedRegexp | ||
title: failedRegexp, | ||
image: failedImage | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14794
12
203
10