Skip to content

Commit

Permalink
Merge branch 'teamcity' of git://github.com/tarasok/jasmine-reporters…
Browse files Browse the repository at this point in the history
… into tarasok-teamcity
  • Loading branch information
putermancer committed Jun 17, 2016
2 parents 035a4e7 + 8b67f11 commit 3e280cd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/teamcity_reporter.js
@@ -1,6 +1,6 @@
(function(global) {
var UNDEFINED,
exportObject;
exportObject, delegates;

if (typeof module !== "undefined" && module.exports) {
exportObject = exports;
Expand Down Expand Up @@ -46,10 +46,17 @@
*
* jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
*/
exportObject.TeamCityReporter = function() {
exportObject.TeamCityReporter = function(options) {
var self = this;
self.started = false;
self.finished = false;

if(options.modifySuiteName && typeof options.modifySuiteName !== 'function') {
throw new Error('option "modifySuiteName" must be a function');
}

delegates = {};
delegates.modifySuiteName = options.modifySuiteName;

var currentSuite = null,
totalSpecsDefined,
Expand Down Expand Up @@ -149,6 +156,9 @@
}
for (var prop in attrs) {
if (attrs.hasOwnProperty(prop)) {
if(delegates.modifySuiteName && prop === 'name') {
attrs[prop] = delegates.modifySuiteName(attrs[prop]);
}
str += " " + prop + "='" + escapeTeamCityString(attrs[prop]) + "'";
}
}
Expand Down

0 comments on commit 3e280cd

Please sign in to comment.