Similarly to other colleagues I had this issue with an Array comparison, I was basically testing a function that got the largest string in an array, additionally it should return an array if more than 1 of those strings matched the largest length possible.
When I started testing I got the following message:
So I replaced the toBe
method
expect(function(array1)).toBe('one result')
with toStrictEqual
to make a deep equality comparison
expect(function(array2)).toStrictEqual(['more than one', 'more than one']);