jasonkuhrt / react-popover

A smart popover component for React
600 stars 240 forks source link

CSS-Vendor library is breaking jest tests #209

Open dmitrif opened 5 years ago

dmitrif commented 5 years ago

Given a component that simply imports react-popover:

import Popover from 'react-popover'

Jest tests break with:

 FAIL  src/components/SomeComponent.test.jsx
  ● Test suite failed to run

    TypeError: Cannot read property '_ownerDocument' of undefined

      at exports.matchesDontThrow (node_modules/jsdom/lib/jsdom/living/helpers/selectors.js:8:27)
      at setPropertiesFromRule (node_modules/jsdom/lib/jsdom/browser/Window.js:536:72)
      at forEach.call.rule (node_modules/jsdom/lib/jsdom/browser/Window.js:552:11)
          at Array.forEach (<anonymous>)
      at readStylesFromStyleSheet (node_modules/jsdom/lib/jsdom/browser/Window.js:546:15)
      at Window.getComputedStyle (node_modules/jsdom/lib/jsdom/browser/Window.js:557:5)
      at Object.<anonymous> (../../.nodenv/versions/8.11.1/lib/node_modules/react-popover/node_modules/css-vendor/lib/supported-property.js:37:25)