segment-integrations / analytics.js-integration-livechat

The Livechat analytics.js integration.
https://segment.com/docs/integrations/livechat/
MIT License
0 stars 1 forks source link

Fix failing tests in PhantomJS #2

Closed ndhoule closed 9 years ago

ndhoule commented 9 years ago

LiveChat does a lot of JSONP-based polling, and our cleanup scripts result in the removal of globals those JSONP handlers rely on. PhantomJS doesn't handle uncaught exceptions very well, so it shits the bed before the tests can finish.

We're now mocking out the LiveChat library rather than loading it (there's still one test that checks for successful load) to get around this issue.

Some long-term fixes we could do: Fix duo-test so it installs a global Phantom error handler (http://phantomjs.org/api/phantom/handler/on-error.html), but that would involve a not-insignificant refactoring of duo-test. For now this will fix the CI failures we're seeing, though.