I try to check that function return an empty object. I can not use asser equal for that:
assert.equal({},{},"Can not compare empty objects");
Is that bug or feature?
Thanks,
Libor
.equal uses strict equality (===). This works for numbers, strings, booleans
http://chaijs.com/api/bdd/#equal-section
For comparisons of arrays and objects use .eql which will enumerate through and check that the contained objects are equal
http://chaijs.com/api/bdd/#eql-section
I understood that strict equality (===) is done by strictEqual while equal is non-strict equal (==). It is not much comfortable mix assert and bdd packages in the test. Anyway, maybe I found solution using deepEqual for comparing objects.
True. Sorry I always use the expect syntax. Forgot assert has different names. The non strict equal matcher isn't available on the expect syntax (which I like).
@charlierudolph I overlook that sometimes too!
@liborbus assert.deepEqual is exactly what your looking for.
Cheers!
Most helpful comment
@charlierudolph I overlook that sometimes too!
@liborbus
assert.deepEqualis exactly what your looking for.Cheers!