Closed zfLQ2qx2 closed 3 days ago
Can you provide the JSDOM version that is not working, the errors or behavior you experience, and a reproduction? This package already does something similar, so I am not sure what issue you may be experiencing that would lead you to generate this code.
I cannot reproduce this issue, and cannot without any further information.
If anyone runs across this thread, please report the issue you are experiencing with JSDOM, Jest, and jest-location-mock versions, and I will reopen. Do no use code you don't understand like the output from ChatGPT. The code provided is a lower quality workaround for mocking window.location
and is incompatible with jest-location-mock.
Credit to ChatGPT for this, a workaround for newer jsdom where they make everything immutable, maybe this can get incorporated into your module