I also want to avoid messing with globals as it opens memory leaks and other issues.
Looking at other issues I know it's been suggested to redefine globals as temporary variables const document_ = document, and that's what I'm doing now, but I'd rather want to have rewire take care of it.
@laggingreflex. We had it working in an initial version but removed it due to its unstable nature. Maybe we can add it in a future version, but it will take some time and I am not 100% sure if this will work.
It seems support for global was removed some time in the past. Any chance it might be reconsidered?
I wanted to rewire
document
andlocation
which are globals but only in browser.It also seems that
sinon
has a problem if you defineglobal.document = {}
https://github.com/sinonjs/sinon/issues/719.I also want to avoid messing with globals as it opens memory leaks and other issues.
Looking at other issues I know it's been suggested to redefine globals as temporary variables
const document_ = document
, and that's what I'm doing now, but I'd rather want to have rewire take care of it.