diff --git a/test/parser.js b/test/parser.js index d7b3273..297ba3a 100644 --- a/test/parser.js +++ b/test/parser.js @@ -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(''); }); }());