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: improve how errors are returned #29

Merged
merged 7 commits into from
Feb 5, 2022
Merged

Conversation

kyranet
Copy link
Member

@kyranet kyranet commented Jan 31, 2022

I heard you like readable errors, well, let's take that on a whole different level!

Pending to implement all code and fix tests

@favna
Copy link
Member

favna commented Jan 31, 2022

ewwoz

@vladfrangu
Copy link
Member

Where's the ban button when you need it... 😮‍💨

@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2022

Codecov Report

Merging #29 (41bebea) into main (88d82ed) will increase coverage by 6.15%.
The diff coverage is 81.98%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   63.54%   69.70%   +6.15%     
==========================================
  Files          34       36       +2     
  Lines         727      845     +118     
  Branches      164      174      +10     
==========================================
+ Hits          462      589     +127     
+ Misses        251      242       -9     
  Partials       14       14              
Impacted Files Coverage Δ
src/constraints/BooleanConstraints.ts 33.33% <0.00%> (ø)
src/validators/LiteralValidator.ts 76.92% <0.00%> (ø)
src/validators/ArrayValidator.ts 22.72% <25.00%> (+3.67%) ⬆️
src/validators/SetValidator.ts 22.72% <25.00%> (+3.67%) ⬆️
src/constraints/DateConstraints.ts 29.72% <30.43%> (-8.21%) ⬇️
src/constraints/BigIntConstraints.ts 33.33% <33.33%> (-11.67%) ⬇️
src/validators/UnionValidator.ts 27.27% <80.00%> (+1.69%) ⬆️
src/constraints/NumberConstraints.ts 100.00% <100.00%> (+3.84%) ⬆️
src/constraints/StringConstraints.ts 100.00% <100.00%> (+19.04%) ⬆️
src/index.ts 100.00% <100.00%> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88d82ed...41bebea. Read the comment docs.

@kyranet kyranet marked this pull request as ready for review February 1, 2022 10:38
src/constraints/BigIntConstraints.ts Outdated Show resolved Hide resolved
@kyranet kyranet requested a review from favna February 3, 2022 11:27
src/constraints/DateConstraints.ts Outdated Show resolved Hide resolved
@kyranet kyranet requested a review from favna February 3, 2022 19:48
favna
favna previously approved these changes Feb 3, 2022
src/constraints/BooleanConstraints.ts Outdated Show resolved Hide resolved
tests/lib/errors/ConstraintError.test.ts Outdated Show resolved Hide resolved
tests/lib/errors/ExpectedValidationError.test.ts Outdated Show resolved Hide resolved
tests/lib/errors/ValidationError.test.ts Outdated Show resolved Hide resolved
tests/validators/number.test.ts Show resolved Hide resolved
@kyranet kyranet requested review from vladfrangu and favna February 4, 2022 10:51
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

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

Nice

@favna favna changed the title refactor: improve errors feat: improve how errors are returned Feb 5, 2022
@favna favna merged commit 8bc7669 into main Feb 5, 2022
@favna favna deleted the refactor/better-errors branch February 5, 2022 14:52
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.

4 participants