I am trying to test a class which returns values depending on values present in window object.
window.test = 123;
I want to mock the window object's test property to 123 value to be able to test correctly.
I tried Object.defineProperty, using global instead, but nothing seems to work. Seems like a trivial question but not able to find the answer on google or elsewhere. Please advice.