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
DOM Testing Library uses instanceof to check whether a query is passed a
RegExp, a Function or a string arg. For some reason on Firefox when a
RegExp is passed to a query the `arg instanceof RegExp` check is always
false, resulting in RegExp arguments being treated like a string. It
appears that this is because the RegExp that is created in executeQuery
is not the same class as that used in the instanceof check in DTL.
I'm not sure exactly what could be causing it, it's possible that
this is due to a polyfill or how we are adding DTL to the page, or
something completely different.
Assigning the RegExp that is in scope in executeQuery to window.RegExp
seems to fix the problem, presumably because it overrides whatever
modified RegExp class was added by the UMD script.
0 commit comments