Open Ellisande opened 8 years ago
Feature
Add a deep equal matcher for matching objects and arrays. Object
const a = { a: 1, b: 2 }; const b = { a: 1, b: 2 }; a === b; //this is false deepEquals(a).matches(b); //this should be true
Arrays
const a = [1, 2 ,3]; const b = [1, 2, 3]; a === b; //this is false; deepEquals(a).matches(b); //this should be true
This matcher didn't exist, making it hard to test inputs that are derived object literals.
It'll make it much easier to stub methods that are expecting objects or arrays as part of their arguments.
Chai already has an implementation of this in their code base somewhere, so feel free to borrow from them, or create one from scratch.
Hi,
I put up a pull request to add this functionality.
What kind of issue is this? (bug, feature, etc)
Feature
What is the proposed change?
Add a deep equal matcher for matching objects and arrays. Object
Arrays
What was the old behavior, if any?
This matcher didn't exist, making it hard to test inputs that are derived object literals.
Why will this be beneficial?
It'll make it much easier to stub methods that are expecting objects or arrays as part of their arguments.
Misc. info
Chai already has an implementation of this in their code base somewhere, so feel free to borrow from them, or create one from scratch.