processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.4k stars 3.28k forks source link

Adding unit tests for event listeners #6764

Open RandomGamingDev opened 7 months ago

RandomGamingDev commented 7 months ago

Increasing access

This would make it easier to test, and thus make sure that the event listeners are functioning properly on all platforms. While event listeners may seem simple and not worth the effort to unit test, they can conflict or have obvious issues that are prevalent, but not easily found due to the differences between platforms that plague them.

For instance, the touchStarted() & touchEnded() functions, which both had doubling issues and issues with working with their corresponding mouse functions mousePressed() & mouseReleased() which wasn't detected for a long time and meant serious issues with mobile sketches. The PRs are listed below:

Most appropriate sub-area of p5.js?

Feature request details

Create a system for unit testing all of the event listeners and even combinations of related ones in order to make sure that they function properly.