nhagen/react-intercom

Crash when ran headless (jest / enzyme test)

Opened this issue · 1 comments

NextJS project with jest / enzyme test that tests a template with react-intercom component on it gives this error:

TypeError: Cannot read property 'parentNode' of undefined
      at node_modules/react-intercom/lib/index.js:73:10

I see you forked to solve this for your case. Hasn't been updated in a while, but that code is taken directly from Intercom's tag. I'd rather recommend excluding this component in dev/headless environments rather than modifying the source. Thoughts?