chai-structured-like
A Chai plugin with chainable helper assertions, comparing the structure of two objects
What it does
Asserts that two objects has the same structure. The structure of objects are equal when:
- The objects have the same number of properties
- The properties match by name
- The properties match by type
So { a: 0, b: true, c: "hi" }
and { a: 0, b: false, c: "hello" }
are considered structurally equal
How to install it
npm install chai-structured-like --save
How to use it
You can compare the structure of two objects:
tobe
Or even compare the structure of nested objects:
tobe
Or use the shorter structured
alias
tobe