You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for the interesting and useful solution, which jsdom-global definitely is.
Though let me notice there is still a difference between the real browsers behavior and the environment emulated on the node using jsdom-global. In the real browser:
window.foo=1;
typeof foo; // => 'number'
Unfortunately in the emulated environment on node -r jsdom-global/register:
window.foo=1;
typeof foo; // => 'undefined'
Let me ask - is it possible to fix the above disadvantage?
I have the impression that identifing window with global seems to be easy achievable by changing in the jsdom-global/index.js only the little piece of the existing code:
Now in the emulated environment on node -r jsdom-global/register we have
window.foo=1;
typeof foo; // => 'number'
Unfortunately it is not the correct solution - for example after the change the window.DOMParser lost, though DOMException, DOMImplementation or DOMTokenList are available as globally as well as the window members...
(I suppose the cleanup behavior may also require some tuning because after the proposed change it could be the "one way ticket")
The text was updated successfully, but these errors were encountered:
First of all, thanks for the interesting and useful solution, which
jsdom-global
definitely is.Though let me notice there is still a difference between the real browsers behavior and the environment emulated on the node using
jsdom-global
. In the real browser:Unfortunately in the emulated environment on
node -r jsdom-global/register
:Let me ask - is it possible to fix the above disadvantage?
I have the impression that identifing
window
withglobal
seems to be easy achievable by changing in thejsdom-global/index.js
only the little piece of the existing code:as follows:
Now in the emulated environment on
node -r jsdom-global/register
we haveUnfortunately it is not the correct solution - for example after the change the
window.DOMParser
lost, thoughDOMException
,DOMImplementation
orDOMTokenList
are available as globally as well as thewindow
members...(I suppose the
cleanup
behavior may also require some tuning because after the proposed change it could be the "one way ticket")The text was updated successfully, but these errors were encountered: