Specify Window.location For Each Test File For Jest
I am upgrading to Jest 22 and I got some problem about mocking window.location. In past, this method is work fine but not work after upgraded. Object.defineProperty(window.location
Solution 1:
Solution from jest collaborator for June 2019:
deleteglobal.window.location;
global.window = Object.create(window);
global.window.location = {
port: '123',
protocol: 'http:',
hostname: 'localhost',
}
Post a Comment for "Specify Window.location For Each Test File For Jest"