update tests

This commit is contained in:
AJ ONeal 2017-02-11 09:03:29 -07:00
parent f71b9b5aff
commit bfce448a96
1 changed files with 12 additions and 2 deletions

View File

@ -26,8 +26,11 @@
if (Array.isArray(val)) { if (Array.isArray(val)) {
// assumes that arrays do not contain non-primitive values (no nested objects or arrays) // assumes that arrays do not contain non-primitive values (no nested objects or arrays)
if (!val[0] || 'object' !== typeof val[0]) {
return assert.deepEqual(val, actual[key]); return assert.deepEqual(val, actual[key]);
} }
return deepLike(val, actual[key]);
}
if (val !== actual[key]) { if (val !== actual[key]) {
// value should always be a primitive by now (we do not expect functions) // value should always be a primitive by now (we do not expect functions)
@ -65,6 +68,13 @@
// TODO deepHas // TODO deepHas
// compare two objects and make sure that the second has all of what the first has (but perhaps more) // compare two objects and make sure that the second has all of what the first has (but perhaps more)
try {
deepLike(expected, result); deepLike(expected, result);
} catch(e) {
console.error('[FAIL]', name);
console.error(e.stack);
console.log('');
}
console.log('');
}); });
}()); }());