What is the difference between ‘toBe’ and ‘toEqual’ in Jest?
It fails cause x and y are different instances and not equal as in (x === y) === false. You can use toBe for primitives like strings, numbers or booleans for everything else use toEqual. For example x = 4 y = 4 x === y // true x = ‘someString’ y = ‘someString’ x … Read more