I am trying to claim that the object contains another (ei deep equal cannot be used), but it seems that the nested ones are checked strictly.
Code example:
describe('Meta', function () { it('object should contains a cloned copy', function () { var obj = {a: 1, b: '2', c: {a: 2, b: '2'}}; return expect(obj).deep.contains(JSON.parse(JSON.stringify(obj))); }); });
Error message:
AssertionError: expected { a: 1, b: '2', c: { a: 2, b: '2' } } to have a property 'c' of { a: 2, b: '2' }, but got { a: 2, b: '2' }
Is there a way to make "contains" with "deep equal" functions?
source share