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
I'm having an annoying issue where this all works locally but running with js-dom in travisCI, it can't find document (it's null), so this package breaks the tests, unfortunately.
Error: Uncaught [TypeError: Cannot read property 'scrollingElement' of null]
at calcScrollableElements (/home/travis/build/rpearce/react-medium-image-zoom/node_modules/focus-options-polyfill/index.js:41:18)
It might be a good idea to change those to be != null instead of typeof ... === "undefined". Using != null covers both undefined and null use cases. Another option would be simply to use the ! operator in front of each one.
What do you think?
The text was updated successfully, but these errors were encountered:
But I'm pretty sure that both the ! operator and != null will throw if document doesn't exist at all, e.g. in Node... So both typeof and one of these would be necessary..
Anyhow, why is JSDOM setting document to null in your setup? Isn't emulating document (and the rest of the DOM) basically the whole point there? 😅
I'm having an annoying issue where this all works locally but running with js-dom in travisCI, it can't find
document
(it'snull
), so this package breaks the tests, unfortunately.https://github.com/calvellido/focus-options-polyfill/blob/master/index.js#L3-L9
It might be a good idea to change those to be
!= null
instead oftypeof ... === "undefined"
. Using!= null
covers bothundefined
andnull
use cases. Another option would be simply to use the!
operator in front of each one.What do you think?
The text was updated successfully, but these errors were encountered: