-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Hey ,
I’d like to propose some improvements to mathUtils.test.js to enhance its test coverage, maintainability, and robustness. Before opening a PR, I’d love to get your thoughts on these changes.
Proposed Changes:
Refactor toDirection tests using test.each - This makes test cases cleaner and reduces redundancy.
Add edge case tests for invalid inputs -Ensure toDirection properly handles non-numeric values (null, undefined, NaN, strings).
Enhance calculateMidpoint tests by:
- Handling large number of stops (performance testing).
- Ensuring identical points return the same location correctly.
- Standardize lon usage instead of mixing lng and lon for consistency.
Implementation Plan:
- Refactor toDirection tests using test.each to reduce duplication.
- Add edge case handling for invalid inputs (null, undefined, NaN).
- Expand calculateMidpoint tests:
Test with large datasets (1000+ stops).
Verify identical stops return the same result. - Ensure consistent variable naming (lon instead of lng).
Relevant File:
mathUtils.test.js
Metadata
Metadata
Assignees
Labels
No labels