Add comprehensive tests and improve type safety for array utilities - #1191
Add comprehensive tests and improve type safety for array utilities#1191pavankumar-vh wants to merge 1 commit into
Conversation
Bug Fix: - Fix loose 'any[]' typing in groupConsecutive function - Add proper Group type definition for improved type safety - This prevents type-related bugs when using the return value Tests Added: - Add 28 comprehensive tests covering all three utility functions - filterDefined: 6 tests for null/undefined filtering with edge cases - buildArray: 10 tests for array flattening and falsy value removal - groupConsecutive: 12 tests for grouping logic with complex key functions - All tests pass with 100% coverage of the utility functions Scope: common/ (approved contribution area)
|
Nice first contribution. The core fix in The test file is thorough and well-organized (filterDefined, buildArray, groupConsecutive each covered with sensible edge cases: empty arrays, all-falsy, nested flattening, deep-equality grouping via A couple of minor nits a maintainer may want addressed before porting:
Overall this is exactly the shape of PR that's easy to review and easy to port: small semantic diff, tests added in the same directory as the source, no dependency or API changes. Good work — happy to see this land. |
Bug Fix:
Tests Added:
Scope: common/ (approved contribution area)