chovy
chovy

Reputation: 75656

mocha chai expect error

AssertionError: expected [] to equal []
Expected :[]
Actual   :[]

My test is this:

newJobFavored[key].should.equal(favJob[key]);

I upgraded all the packages recently and this broke. It appears it should pass if they are two empty arrays.

Upvotes: 0

Views: 194

Answers (1)

TMG
TMG

Reputation: 2740

equal on arrays just compares if it is the same object.

You need a deep compare with eql instead of equal to compare content of the arrays:

newJobFavored[key].should.eql(favJob[key]);

Upvotes: 2

Related Questions