Allow individual specs to be rerun; show skipped tests in gray.

This commit is contained in:
Aaron Peckham & Christian Williams
2009-08-10 15:39:48 -07:00
parent 22226f3423
commit e476f2375a
4 changed files with 34 additions and 8 deletions

View File

@@ -26,19 +26,22 @@ jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarA
};
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
console.log(runner);
};
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
console.log(suite);
};
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
var specDiv = this.createDom('div', {
className: spec.getResults().passed() ? 'spec passed' : 'spec failed'
}, spec.getFullName());
var results = spec.getResults();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}
var specDiv = this.createDom('div', { className: 'spec ' + status },
this.createDom('a', { className: 'runSpec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
spec.getFullName());
var resultItems = spec.getResults().getItems();
var resultItems = results.getItems();
for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];
if (!result.passed) {

View File

@@ -20,12 +20,13 @@ p {
color: red;
}
.fail_in_summary {
.failInSummary {
color: red;
}
.spec {
margin: 5px;
clear: both;
}
.passed {
@@ -36,6 +37,11 @@ p {
background-color: pink;
}
.skipped {
color: #777;
background-color: #eee;
}
.resultMessage {
white-space: pre;
}
@@ -49,3 +55,8 @@ p {
border-left: 1px solid red;
padding-left: 5em;
}
.runSpec {
margin-left: 5px;
float: right;
}