Skip to content

Add many more tests for array behavior and update scenarios#1181

Merged
markerikson merged 2 commits intomainfrom
feature/more-array-tests
Oct 6, 2025
Merged

Add many more tests for array behavior and update scenarios#1181
markerikson merged 2 commits intomainfrom
feature/more-array-tests

Conversation

@markerikson
Copy link
Collaborator

@markerikson markerikson commented Oct 6, 2025

This PR:

  • Adds a fairly extensive set of additional tests to base.js covering expected array method behavior
  • Adds a set of "update scenario" tests that match the scenarios in the immutability benchmarks file. This both adds assertions that Immer's results match a vanilla JS reducer, and gives a handy way to rerun an individual test to drill down on Immer behavior in development.

Some of the array tests were related to edge cases I thought of (such as touching an array field to create a proxy, then sorting or reversing it). The majority were AI-generated to fill out expected behaviors before I started trying to override any array methods.

@coveralls
Copy link

coveralls commented Oct 6, 2025

Pull Request Test Coverage Report for Build 18285951986

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 54.732%

Totals Coverage Status
Change from base Build 17672956739: 0.03%
Covered Lines: 1236
Relevant Lines: 2681

💛 - Coveralls

@markerikson markerikson changed the title Add many more tests for array behavior Add many more tests for array behavior and update scenarios Oct 6, 2025
@markerikson markerikson force-pushed the feature/more-array-tests branch from 429eac3 to 773455a Compare October 6, 2025 15:25
@markerikson
Copy link
Collaborator Author

@mweststrate Since you did give me commit rights, I'm going to go ahead and land any infrastructure-related PRs (tests, perf benchmarks, CI improvements) on my own. I'll defer on any of the actual behavior changes so that you can review and we can discuss them.

@markerikson markerikson merged commit 6b23c37 into main Oct 6, 2025
2 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 10.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants