Skip to content

[p5.js 2.0+ Bug Report]: Missing unit tests for isLooping() return value #8979

Description

@harshiltewari2004

Most appropriate sub-area of p5.js?

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

p5.js version

current main (5743cb5)

Web browser and version

N/A — test coverage gap, not a runtime bug

Operating system

N/A — same reason

Steps to reproduce this

isLooping() (src/core/structure.js) returns the internal _loop flag and is
documented in its JSDoc as supported usage — but its return value is never
tested. There are currently zero references to isLooping anywhere under
test/; the existing loop()/noLoop() suite in
test/unit/core/structure.js asserts only on frameCount behavior and never
calls isLooping().

Proposed tests (test-only, no source changes):

  • isLooping() returns true by default while the draw loop is running
  • returns false after noLoop()
  • returns true again after a subsequent loop()

I'd like to fix this myself if approved.

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions