I'm working with jest + enzyme setup for tests. I have function that conditionally renders something if window is defined.
In my test suite I'm trying to reach second case, when window is not defined, but I can't force it.
it('makes something when window is not defined', () => { window = undefined; expect(myFunction()).toEqual(thisWhatIWantOnUndefinedWinow); });
But even if I force window to be undefined, it doesn't reach expected case, window is always window (jsdom?)
Is it something with my jest setup or I should handle this another way?