mediumStudy question · answer published in Automation Testing interview questions, so no pointsvitestunit-testing
toBe fails on equal objects
Why does this test fail even though both objects look the same?
expect(getUser()).toBe({ id: 1, name: 'Ana' })Discussion 0
Join free to post in the discussion.
Related questions
- Unit testing a ViewModelMobile App Developer
- Unit testing driver logicEmbedded Systems Engineer
- Arrange, Act, AssertAutomation Test Engineer
- A toThrow test that errorsAutomation Test Engineer
- Expecting an exception in JUnit 5Automation Test Engineer
- Full line coverage, half the branchesAutomation Test Engineer
- A test that passes for the wrong reasonAutomation Test Engineer
- Testing a private helperAutomation Test Engineer