Currently, I am implementing unit test for my project and there is a file that contained window.location.href.
window.location.href
I want to mock this to test and here is m
Solution for 2019 from GitHub:
delete global.window.location; global.window = Object.create(window); global.window.location = { port: '123', protocol: 'http:', hostname: 'localhost', };