Open felquis opened 9 years ago
You are right, this solution is not good - we should not mix the logic of the tests within the main code. A solution to it is: make public the isTouch attribute and within the test change it to false or true.
But in fact, phantom has another problem that I need to solve. It don't the Event object. Because of it, I'm just running the tests in the browser for now =/
The problem is that
'ontouchevent' in window
returntrue
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:But I don't think this is a good solution.