Skip to content

test: add edge case coverage for Array.prototype.map#5220

Open
ParthMozarkar wants to merge 4 commits intoboa-dev:mainfrom
ParthMozarkar:test-array-map-edge-cases
Open

test: add edge case coverage for Array.prototype.map#5220
ParthMozarkar wants to merge 4 commits intoboa-dev:mainfrom
ParthMozarkar:test-array-map-edge-cases

Conversation

@ParthMozarkar
Copy link
Contributor

I added test cases for Array.prototype.map covering some important
edge cases that weren't tested before:

  • Empty array
  • Callback returning undefined
  • Sparse array (holes should be preserved)
  • Identity mapping

No existing tests were removed or modified.

Raising this as a draft for review — let me know if any changes
are needed!

@github-actions github-actions bot added C-Tests Issues and PRs related to the tests. Waiting On Review Waiting on reviews from the maintainers labels Mar 22, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Mar 22, 2026
@ParthMozarkar ParthMozarkar marked this pull request as ready for review March 22, 2026 10:54
@ParthMozarkar ParthMozarkar requested a review from a team as a code owner March 22, 2026 10:54
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to do all Array functions. Test262 are doing every function in the spec and all edge cases already.

@github-actions
Copy link

github-actions bot commented Mar 22, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 50,545 50,545 0
Ignored 1,426 1,426 0
Failed 992 992 0
Panics 2 2 0
Conformance 95.43% 95.43% 0.00%

Tested main commit: 66a1cd268ce6006918032b5d0f98d3a63c81b188
Tested PR commit: 637541e28725745ff3626eba2f8d955a00deef37
Compare commits: 66a1cd2...637541e

@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.79%. Comparing base (6ddc2b4) to head (637541e).
⚠️ Report is 916 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5220       +/-   ##
===========================================
+ Coverage   47.24%   59.79%   +12.55%     
===========================================
  Files         476      582      +106     
  Lines       46892    63460    +16568     
===========================================
+ Hits        22154    37948    +15794     
- Misses      24738    25512      +774     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ParthMozarkar
Copy link
Contributor Author

We don't need to do all Array functions. Test262 are doing every function in the spec and all edge cases already.

Thanks for the approval and the feedback! Understood I won't add
more Array test PRs since test262 already covers those. I'll focus
on more meaningful contributions going forward!

@github-actions github-actions bot added the C-Builtins PRs and Issues related to builtins/intrinsics label Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Builtins PRs and Issues related to builtins/intrinsics C-Tests Issues and PRs related to the tests. Waiting On Review Waiting on reviews from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants