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