LearnBoost/expect.js — Issue #5: Assertion for comparing objects recursively with strict equality
Author: rauschma
Created: 2012-01-09 02:47:39+00:00
State: open

Examples:

expect({ a: 3 }).to.equalRec({ a: '3' }) // fails
expect({ a: 3 }).to.equalRec({ a: 3 }) // succeeds

Objects are compared by comparing the values of their properties via strict equality `===`.

Signature:

equalRec([recursionDepth=1], value)

A `recursionDepth` of 0 means: compare objects with strict equals. A `recursionDepth` > 0 means: compare the properties of objects via `equalRec(recursionDepth-1)`.

Optional: create a similar analog of `eql()` called `eqlRec()`