p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Adding unit tests for event listeners

Open RandomGamingDev opened this issue 5 months ago • 0 comments

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:

  • https://github.com/processing/p5.js/pull/6738
  • https://github.com/processing/p5.js/pull/6740

Most appropriate sub-area of p5.js?

  • [ ] Accessibility
  • [ ] Color
  • [ ] Core/Environment/Rendering
  • [ ] Data
  • [ ] DOM
  • [X] Events
  • [ ] Image
  • [X] IO
  • [ ] Math
  • [ ] Typography
  • [ ] Utilities
  • [ ] WebGL
  • [ ] Build process
  • [X] Unit testing
  • [ ] Internationalization
  • [ ] Friendly errors
  • [ ] Other (specify if possible)

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.

RandomGamingDev avatar Jan 23 '24 00:01 RandomGamingDev