There may be a situation where you need to mock methods or properties on window.location in Jest. However, because of peculiarities of jsdom, this could be challenging. In this post there is one of the possible solutions to this problem.
Jest: How to Mock window.location.href
![Jest: How to Mock window.location.href Jest: How to Mock window.location.href](https://wildwolf.name/wp-content/uploads/2019/11/jest-750x350.png)