Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better invalid unit error handling #95

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Conversation

scytacki
Copy link
Member

@scytacki scytacki commented Nov 4, 2024

  • the UnitManager now doesn't crash when initializeMath is called and there is an invalid unit
  • the _ char is explicitly allowed to be a unit character
  • invalid units are not added to the unit manager
  • updated custom-math test so each test is isolated with its own instance of the units manager.
  • removed what seemed like an unnecessary explicit "addUnit" call in variable.test.ts
  • grouped invalid unit tests in variable.test.ts
  • added tests for invalid characters of various types.

- the UnitManager now doesn't crash when initializeMath is called and there is an invalid unit
- the `_` char is explicitly allowed to be a unit character
- invalid units are not added to the unit manager
- updated custom-math test so each test is isolated with its own instance of the units manager.
- removed what seemed like an unnecessary explicit "addUnit" call in variable.test.ts
- grouped invalid unit tests in variable.test.ts
- added tests for invalid characters of various types.
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.05%. Comparing base (f8c2080) to head (b4d827b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   72.03%   72.05%   +0.02%     
==========================================
  Files          47       47              
  Lines        1280     1281       +1     
  Branches      295      295              
==========================================
+ Hits          922      923       +1     
  Misses        343      343              
  Partials       15       15              
Flag Coverage Δ
jest 72.05% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@scytacki scytacki marked this pull request as ready for review November 4, 2024 14:33
@scytacki scytacki requested a review from bgoldowsky November 4, 2024 14:42
Copy link
Contributor

@bgoldowsky bgoldowsky left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@scytacki scytacki merged commit 5b19e81 into main Nov 6, 2024
7 checks passed
@scytacki scytacki deleted the 188476962-handle-invalid-units branch November 6, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants