Ox.test: handle non-null values for which JSON.stringify returns 'null'

This commit is contained in:
rolux 2012-06-13 09:06:54 +02:00
parent 4dc11cd256
commit 110be11a05

View file

@ -822,7 +822,10 @@ Ox.test = function(argument, callback) {
}
if (!isAsync && test.expected) {
Ox.test.data[id].results.push({
actual: JSON.stringify(actual),
actual: Ox.isEqual(actual, -0) ? '-0'
: Ox.isNaN(actual) ? 'NaN'
: Ox.isUndefined(actual) ? 'undefined'
: JSON.stringify(actual),
expected: test.expected,
name: item.name,
section: item.section,