This extends chai.js with deep equality member checks, optionally also tracking
the identity of nested objects (see deep-equal-ident
)
for more info on that.
npm install chai-members-deep
chai.use(require('chai-members-deep'));
The require
and should
interfaces already provided the ability to test for
members with the deep
flag. This extensions adds the equivalent methods to the
assert
interface:
assert.sameMembersDeep(a, b);
assert.sameMembersDeepIdent(a, b);
assert.includeMembersDeep(a, b);
assert.includeMembersDeepIdent(a, b);
Since it uses the chai extension of deep-equal-ident
, it also includes
expect(a).to.identically.deep.equal(b);
assert.deepEqualIdent(a, b);