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

feat: Add StrictEnumField with better validation #222

Merged
merged 1 commit into from
May 2, 2024

Conversation

wschurman
Copy link
Member

Why

Not having this more strict validation I think was an oversight. But it's too late to add it to EnumField since there needs to be a path to gradually migrate since some fields may not be providing valid values currently.

How

Add StrictEnumField, which also takes the enum type as an argument and validates against the possible values.

Test Plan

Run test.

@wschurman wschurman requested review from quinlanj and ide May 2, 2024 18:00
Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.48%. Comparing base (3377129) to head (05c2bb7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #222      +/-   ##
==========================================
+ Coverage   95.46%   95.48%   +0.01%     
==========================================
  Files          79       79              
  Lines        2074     2080       +6     
  Branches      282      283       +1     
==========================================
+ Hits         1980     1986       +6     
  Misses         88       88              
  Partials        6        6              
Flag Coverage Δ
integration 95.48% <100.00%> (+0.01%) ⬆️
unittest 95.48% <100.00%> (+0.01%) ⬆️

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.

@wschurman wschurman merged commit 8753252 into main May 2, 2024
3 checks passed
@wschurman wschurman deleted the @wschurman/strict-enum-field branch May 2, 2024 18:30
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