PhantomJS does not support the CustomEvent method, added a polyfill to fallback to the legacy document.createEvent method. Use $.fn.triggerNative to fire native events now.