Ask Your Question
2

Why is the background movement test in React Testing Library failing and showing an error message with 'not.toEquals'?

asked 2021-11-20 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-02-12 12:00:00 +0000

scrum gravatar image

The reason why the background movement test in React Testing Library is failing and showing an error message with 'not.toEquals' is that 'not.toEquals' is not a valid matcher in Jest or React Testing Library.

The correct matcher to use to compare objects for inequality in Jest is 'not.toEqual'.

Therefore, the test should be updated to use 'not.toEqual' instead of 'not.toEquals'.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-11-20 11:00:00 +0000

Seen: 14 times

Last updated: Feb 12 '22