I found a working method by declaring in the beginning of the test a global variable:
global.window = { location: { pathname: null } };
and checked this variable like this:
expect(global.window.location.pathname).toEqual('/new-url');
That worked fine.