react-testing-libraryのtoBeとtoEqualの違い
toBeがcheckByReferenceでtoEqualがcheckByValueOnRecursive いくつか例を挙げておく
expect(1).toBe("1") -> false expect(1).toEqual("1") -> false let a = { foo:"bar" } let b = { foo:"bar" } expect(a).toBe(b) -> false expect(a).toEqual(b) -> true
参考
https://stackoverflow.com/questions/22413009/jasmine-javascript-testing-tobe-vs-toequal
https://dpericich.medium.com/react-testing-with-toequal-vs-tobe-76021acd459e