in Ox.DocPage, display test results
This commit is contained in:
parent
963e594397
commit
359a8984d3
1 changed files with 25 additions and 17 deletions
|
@ -180,7 +180,8 @@ Ox.DocPage = function(options, self) {
|
|||
);
|
||||
if (section == 'tests') {
|
||||
item.tests.forEach(function(test) {
|
||||
$elements.push($('<div>')
|
||||
$elements.push(
|
||||
$('<div>')
|
||||
.addClass(className)
|
||||
.css({marginLeft: (level * 32 + 16) + 'px'})
|
||||
.html(
|
||||
|
@ -191,13 +192,20 @@ Ox.DocPage = function(options, self) {
|
|||
+ '</b></code>'
|
||||
)
|
||||
);
|
||||
test.expected && $elements.push($('<div>')
|
||||
test.expected && $elements.push(
|
||||
$('<div>')
|
||||
.addClass(className)
|
||||
.css({marginLeft: (level * 32 + 16) + 'px'})
|
||||
.html(
|
||||
'<code>' + Ox.encodeHTMLEntities(test.expected) + '</code>'
|
||||
)
|
||||
'<code>' + Ox.encodeHTMLEntities(test.actual || test.expected) + (
|
||||
test.passed === false
|
||||
? ' <span class="OxFailed"> // expected: '
|
||||
+ Ox.encodeHTMLEntities(test.expected)
|
||||
+ '</span>'
|
||||
: ''
|
||||
) + '</code>'
|
||||
)
|
||||
);
|
||||
});
|
||||
} else if (section == 'source') {
|
||||
// fixme: not the right place to fix path
|
||||
|
|
Loading…
Reference in a new issue