jasmine-node
Advanced tools
Comparing version 1.12.1 to 1.13.0
@@ -277,4 +277,4 @@ var util, | ||
function printVersion(){ | ||
console.log("1.12.1"); | ||
console.log("1.13.0"); | ||
process.exit(0); | ||
} |
@@ -50,2 +50,4 @@ (function() { | ||
fail: function() { return '\033[31m'; }, // Red | ||
specTiming: function() { return '\033[34m'; }, // Blue | ||
suiteTiming: function() { return '\033[33m'; }, // Yelow | ||
ignore: function() { return '\033[37m'; }, // Light Gray | ||
@@ -58,2 +60,4 @@ neutral: function() { return '\033[0m'; } // Normal | ||
fail: function() { return ''; }, | ||
specTiming: function() { return ''; }, | ||
suiteTiming: function() { return ''; }, | ||
ignore: function() { return ''; }, | ||
@@ -216,2 +220,5 @@ neutral: function() { return ''; } | ||
this.indent_ = 0; | ||
this.specTimes_ = {}; | ||
this.suiteTimes_ = {}; | ||
this.suiteResults_ = {}; | ||
} | ||
@@ -221,3 +228,18 @@ | ||
jasmineNode.TerminalVerboseReporter.prototype = { | ||
reportSpecStarting: function(spec) { | ||
now = new Date().getTime(); | ||
this.specTimes_[spec.id] = now; | ||
var suite = spec.suite; | ||
while (suite) { | ||
if (!this.suiteTimes_[suite.id]) { | ||
this.suiteTimes_[suite.id] = now; | ||
} | ||
suite = suite.parentSuite; | ||
} | ||
}, | ||
reportSpecResults: function(spec) { | ||
var elapsed = new Date().getTime() - this.specTimes_[spec.id]; | ||
if (spec.results().failedCount > 0) { | ||
@@ -229,6 +251,17 @@ this.addFailureToFailures_(spec); | ||
messages: spec.results().getItems(), | ||
result: spec.results().failedCount > 0 ? 'failed' : 'passed' | ||
result: spec.results().failedCount > 0 ? 'failed' : 'passed', | ||
runtime: elapsed | ||
}; | ||
}, | ||
reportSuiteResults: function(suite) { | ||
var startTime = this.suiteTimes_[suite.id]; | ||
if (startTime) { | ||
var elapsed = new Date().getTime() - startTime; | ||
this.suiteResults_[suite.id] = { | ||
runtime: elapsed | ||
}; | ||
} | ||
}, | ||
reportRunnerResults: function(runner) { | ||
@@ -265,2 +298,4 @@ var messages = new Array(); | ||
} | ||
msg += this.stringWithColor_(" - " + specResult.runtime + " ms", | ||
this.color_.specTiming()); | ||
@@ -270,3 +305,10 @@ messages.push(msg); | ||
messages.push(''); | ||
messages.push(this.indentMessage_(element.name, depth)); | ||
msg = this.indentMessage_(element.name, depth) | ||
if (element.id != null) { | ||
suiteResult = this.suiteResults_[element.id.toString()]; | ||
if (suiteResult) { | ||
msg += this.stringWithColor_(" - " + suiteResult.runtime + " ms", this.color_.suiteTiming()); | ||
} | ||
} | ||
messages.push(msg); | ||
} | ||
@@ -273,0 +315,0 @@ |
{ | ||
"name": "jasmine-node", | ||
"version": "1.12.1", | ||
"version": "1.13.0", | ||
"description": "DOM-less simple JavaScript BDD testing framework for Node", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -133,4 +133,4 @@ jasmine-node | ||
done(); | ||
}, 250); // timeout after 250 ms | ||
}); | ||
}); | ||
}, 250); // timeout after 250 ms | ||
``` | ||
@@ -239,2 +239,3 @@ | ||
* _1.13.0_ Added timing to the verbose reporter (thanks to [rick-kilgore](https://github.com/rick-kilgore)) | ||
* _1.12.1_ Fixed an issue where an undefined variable caused an unhelpful | ||
@@ -241,0 +242,0 @@ exception in --watch Resolves #278 |
@@ -386,2 +386,3 @@ var jasmineNode = require(__dirname + "/../lib/jasmine-node/reporter").jasmineNode; | ||
this.suite = { | ||
id: 17, | ||
type: 'suite', | ||
@@ -402,5 +403,10 @@ name: 'a describe block', | ||
this.verboseReporter.specResults_['23'] = { | ||
result: 'passed' | ||
result: 'passed', | ||
runtime: 200 | ||
}; | ||
this.verboseReporter.suiteResults_['17'] = { | ||
runtime: 500 | ||
}; | ||
}); | ||
@@ -427,3 +433,3 @@ | ||
expect(messages[0]).toEqual(''); | ||
expect(messages[1]).toEqual('a describe block'); | ||
expect(messages[1]).toEqual('a describe block - 500 ms'); | ||
}); | ||
@@ -443,3 +449,3 @@ | ||
expect(messages.length).toEqual(1); | ||
expect(messages[0]).toEqual('a spec block'); | ||
expect(messages[0]).toEqual('a spec block - 200 ms'); | ||
}); | ||
@@ -469,2 +475,3 @@ | ||
var subSuite = new Object(); | ||
subSuite.id = '29'; | ||
subSuite.type = 'suite'; | ||
@@ -479,2 +486,6 @@ subSuite.name = 'a sub describe block'; | ||
this.verboseReporter.suiteResults_['29'] = { | ||
runtime: 350 | ||
}; | ||
this.verboseReporter.buildMessagesFromResults_(messages, results); | ||
@@ -484,8 +495,8 @@ | ||
expect(messages[0]).toEqual(''); | ||
expect(messages[1]).toEqual('a describe block'); | ||
expect(messages[1]).toEqual('a describe block - 500 ms'); | ||
expect(messages[2]).toEqual(''); | ||
expect(messages[3]).toEqual(' a sub describe block'); | ||
expect(messages[4]).toEqual(' a spec block'); | ||
expect(messages[3]).toEqual(' a sub describe block - 350 ms'); | ||
expect(messages[4]).toEqual(' a spec block - 200 ms'); | ||
}); | ||
}); | ||
}); |
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
160372
4298
277