The problem is that 'ontouchevent' in window return true in PhantomJS and there's no way to disable touch events in PhantomJS on runtime. For this reason, the tests with mouseup are failing.
And because this, the tests for libraries are also failing because when ontouchevent is present we don't actually use libraries to delegate the events but addEventListener.
We could use !global.window.mochaPhantomJS in this line:
if ('ontouchstart' in global && !global.window.mochaPhantomJS) { ... }
But I don't think this is a good solution.
The problem is that
'ontouchevent' in windowreturntruein PhantomJS and there's no way to disable touch events in PhantomJS on runtime. For this reason, the tests with mouseup are failing.And because this, the tests for libraries are also failing because when
ontoucheventis present we don't actually use libraries to delegate the events but addEventListener.We could use
!global.window.mochaPhantomJSin this line:But I don't think this is a good solution.