Is there a way to reinitialize jQuery?

I'm trying to get some help on this stackoverflow question I wrote: https://stackoverflow.com/questions/77602661/is-there-a-way-to-reinitialize-jquery To summarize: I'm using JSDOM to load my webapp and my webapp uses jQuery. JQuery holds onto references of the current global window/window.document (this is an oversimplification and full details are in the question) once jquery is initialized. This prevents me from running tests that use different HTML and that is highly restrictive. I'm looking for a way to reinitialize jQuery in my test code so that I can use a different document per test. Is there a way to do this without modifying my production code that already import jQuery from 'jquery's? PS: Is this question more suitable for #front-end ? IMO, it's kind of both.
1 Reply
ἔρως
ἔρως12mo ago
what exactly are you trying to do? why do you want to mess around with the window and document objects?
Want results from more Discord servers?
Add your server