From bfce448a9680cb1de0647b7c8f655e23345f00c8 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 11 Feb 2017 09:03:29 -0700 Subject: [PATCH] update tests --- test/parser.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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(''); }); }());