0

How do I deep compare 2 JSON objects(having similar keys) in testcafe? Also, is there a way I can store the differences?

I need something like this -

test.requestHooks([requestMock])('deep compare JSON objects', async t => {
  const obj1 = hookedResponses['getJSON1'];
  const obj2 = hookedResponses['getJSON2'];
  const result = await t.compare(obj1, obj2);
});
Sunny
  • 902
  • 3
  • 18
  • 41
  • [There's no such thing as a "JSON Object"](http://benalman.com/news/2010/03/theres-no-such-thing-as-a-json/) – Andreas Sep 24 '20 at 16:19
  • Possible (not familiar with testcafe) dupe: [How to determine equality for two JavaScript objects?](https://stackoverflow.com/questions/201183/how-to-determine-equality-for-two-javascript-objects) – Andreas Sep 24 '20 at 16:22
  • Are you actually talking about JavaScript objects? – Teemu Sep 24 '20 at 16:27

0 Answers0