'heaven' and 'java' have 'av' in common, there are 4 letters different (h removed, both 'e's changed, n removed) 'heaven' and 'php' have only 'h' in common, there are 6 letters different (p added, e changed, a,v,e,n removed)
that will expect false, not true.
Here are the tests:
o1 = {name: 'Joe', surname: 'Smith'}; o2 = {name: 'Joe', surname: 'Smith'}; Test.assertEquals(deepCompare(o1,o2), true, 'should handle objects'); o1 = {name: 'Joe', surname: 'Smith'}; o2 = {surname: 'Smith', name: 'Joe'}; Test.assertEquals(deepCompare(o1,o2), true, 'property order should not matter'); o1 = {name: 'Joe', surname: 'Smith'}; o2 = {name: 'Joe'}; Test.assertEquals(deepCompare(o1,o2), false, 'should detect when a property is missing'); Test.assertEquals(deepCompare(o2,o1), false, 'should detect when a property is missing');
Loading collection data...
'heaven' and 'java' have 'av' in common, there are 4 letters different (h removed, both 'e's changed, n removed)
'heaven' and 'php' have only 'h' in common, there are 6 letters different (p added, e changed, a,v,e,n removed)
that will expect false, not true.
Here are the tests: