States tests and rename#8778
Merged
davepagurek merged 2 commits intoprocessing:dev-2.0from May 10, 2026
Merged
Conversation
Continuous ReleaseCDN linkPublished PackagesCommit hash: b54e540 Previous deploymentsThis is an automated message. |
davepagurek
approved these changes
May 10, 2026
Contributor
davepagurek
left a comment
There was a problem hiding this comment.
Looks great, thanks!
Contributor
|
@all-contributors please add @harshiltewari2004 for code |
Contributor
Author
|
Thank you so much @davepagurek ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #8761
Changes
States.getDiff()→States.takeDiff()to reflect that it mutates state (clears#modifiedafter returning), per discussion in [p5.js 2.0+ Bug Report]: Missing unit tests for src/core/States.js #8761 with @davepagurek.src/core/p5.Renderer.jsto use the new name.test/unit/core/States.jswith 9 tests covering the public API: constructor,setValue,getModified,takeDiff,applyDiff, plus a push/pop integration test.Notes on test results
Local
npm testshows all 9 newStatestests passing. There are 4 pre-existing unrelated timeout failures in visual regression tests (test/unit/visual/cases/noise.js,test/unit/visual/cases/shape_modes.js) that don't reference any of the code I changed — they appear flaky on my machine. Running the new test file in isolation (npx vitest run test/unit/core/States.js) shows clean 9/9 pass.PR Checklist
npm run lintpasses