diff --git a/source/Ox.UI/js/Code/DocPage.js b/source/Ox.UI/js/Code/DocPage.js index 597fcd00..cdc4a328 100644 --- a/source/Ox.UI/js/Code/DocPage.js +++ b/source/Ox.UI/js/Code/DocPage.js @@ -180,24 +180,32 @@ Ox.DocPage = function(options, self) { ); if (section == 'tests') { item.tests.forEach(function(test) { - $elements.push($('
> '
- + Ox.encodeHTMLEntities(test.statement)
- .replace(/ /g, ' ')
- .replace(/\n/g, '
\n ')
- + ''
- )
+ $elements.push(
+ $('> '
+ + Ox.encodeHTMLEntities(test.statement)
+ .replace(/ /g, ' ')
+ .replace(/\n/g, '
\n ')
+ + ''
+ )
+ );
+ test.expected && $elements.push(
+ $('' + Ox.encodeHTMLEntities(test.actual || test.expected) + (
+ test.passed === false
+ ? ' // expected: '
+ + Ox.encodeHTMLEntities(test.expected)
+ + ''
+ : ''
+ ) + ''
+ )
);
- test.expected && $elements.push($('' + Ox.encodeHTMLEntities(test.expected) + ''
- )
- )
});
} else if (section == 'source') {
// fixme: not the right place to fix path