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
In history.js there is a usage of { ...source.location }, which somehow works in the Browser,
but fails in other environments like happy-dom since the Browser behaviour around window.location
can only be emulated with get and set Methods.
Spreading does not take get Methods into account, so things like location.pathname will be undefined afterwards.
My suggestion is explicitely spreading the location, like so:
I also submitted an issue in happy-dom since I consider this a mismatch between the Browser DOM implementation and happy-dom, and it should be fixable on their side as well by adding artificial fields in the location class.
In
history.js
there is a usage of{ ...source.location }
, which somehow works in the Browser,but fails in other environments like happy-dom since the Browser behaviour around window.location
can only be emulated with
get
andset
Methods.Spreading does not take
get
Methods into account, so things likelocation.pathname
will be undefined afterwards.My suggestion is explicitely spreading the location, like so:
What do you think? Or is there a good workaround for testing environments that I am unaware of?
The text was updated successfully, but these errors were encountered: