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
Describe the bug
While I was trying to implement unit testing for my authenticate loaders and actions on my Remix project, I could not launch my test using Happy-DOM. I tried the same tests using JSDOM, and they passed without error.
Describe the bug
While I was trying to implement unit testing for my authenticate loaders and actions on my Remix project, I could not launch my test using Happy-DOM. I tried the same tests using JSDOM, and they passed without error.
After digging into the problem, I found the problem is that the
AbortSignal
andEventTarget
classes don't implement theSymbol.toStringTag
method. Remix is using this method to detect if the signal attached to a Request is an AbortSignal or EventTarget.As a result, this check fails and throws an exception.
To Reproduce
Steps to reproduce the behavior (See Additional context for the link to the repository with the minimal code to reproduce it):
TypeError: Expected signal to be an instanceof AbortSignal
Expected behavior
I expected that it would work as on JSDOM.
Additional context
I made a repository where you can find a minimal reproduction of the bug and a possible workaround until a fix lands in the repository.
If it has low priority, I can make a PR to fix it.Nevermind, I had patched locally the package, I will open an PR ASAP with the fix.This is the workaround
The workaround is based on proxify AbortController and AbortSignal to intercept the call to the method
Symbol.toStringTag
The text was updated successfully, but these errors were encountered: