We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d401412 commit 3ad5425Copy full SHA for 3ad5425
1 file changed
test/unit/events/touch.js
@@ -32,6 +32,13 @@ suite('Touch Events', function() {
32
myp5.remove();
33
});
34
35
+ beforeEach(function() {
36
+ // Reset pointer state so tests don't leak active pointers into each other.
37
+ myp5._activePointers.clear();
38
+ myp5.touches = [];
39
+ myp5.mouseIsPressed = false;
40
+ });
41
+
42
suite('p5.prototype.touches', function() {
43
test('should be an empty array', function() {
44
assert.deepEqual(myp5.touches, []);
@@ -44,6 +51,7 @@ suite('Touch Events', function() {
51
45
52
46
53
test('should contain the touch registered', function() {
54
+ window.dispatchEvent(touchEvent1);
47
55
assert.strictEqual(myp5.touches[0].id, 1);
48
56
49
57
0 commit comments