Uh oh!
There was an error while loading. Please reload this page.
Refactor assertString: Faster, less nested and more consistent. - #2372
Conversation
WikiRik
left a comment
There was a problem hiding this comment.
I think the tests are failing because we currently do not throw an error for '' (an empty string).
Also; can you commit the unit tests as well?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## master #2372 +/- ##
==========================================
- Coverage 99.95% 99.95% -0.01%
==========================================
Files 107 107 Lines 2454 2445 -9 Branches 619 617 -2 ==========================================
- Hits 2453 2444 -9
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi, @WikiRik! |
WikiRik
commented
Feb 9, 2024
codecov/project will be fixed with #2341 |
Uh oh!
There was an error while loading. Please reload this page.
pano9000
commented
Feb 9, 2024
when you pass literally because it is not caught by the first check. Should we explicitly check for null there as well? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
EmersonRabelo
commented
Feb 14, 2024
Hello, @pano9000! |
pano9000
left a comment
There was a problem hiding this comment.
should be ok now :-)
(however my approval is rather useless, as I am not a maintainer)
…datorjs#2372) * refactor: Refactor assertString * refactor: Refactor assertString with unit tests * add: Empty string unit test * add: Null input value and more tests * fix: Sentence correction
…datorjs#2372) * refactor: Refactor assertString * refactor: Refactor assertString with unit tests * add: Empty string unit test * add: Null input value and more tests * fix: Sentence correction
…datorjs#2372) * refactor: Refactor assertString * refactor: Refactor assertString with unit tests * add: Empty string unit test * add: Null input value and more tests * fix: Sentence correction

@profnandaa,
I have a possible improvement for the assertString.
I am reducing the number of necessary validations and also a more assertive approach, in my point of view (if this approach doesn't make sense, I would appreciate feedback on it, if possible).
The performance has also improved, it wasn't something incredible, but it was considerable.
Unit tests:
