Cover the remaining untested branches
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, typescript
- Domain
- testing
Research direction
Start with tests/validators.test.js and the branches named in src/utils/safeRegex.js and src/validators/email.js; the issue says no source changes are needed. Add tests for unsafe patterns, a throwing regex.test(), and non-string email input, then run npm run test:coverage. Done when those branches are covered and the email validator returns the input unchanged while reporting "Invalid email format".
Written by the indexing model from the issue text.
Description
Coverage is 93.8%. A few small branches have no test yet:
src/utils/safeRegex.js,safeRegexTest():- the branch that rejects an unsafe pattern (
'Unsafe regex pattern detected'), e.g./(a+)+$/ - the
catchbranch, whenregex.test()itself throws
- the branch that rejects an unsafe pattern (
src/validators/email.js: thetransformbranch for non-string values, e.g.validators.email(123)should return the value unchanged and fail as "Invalid email format", not crash
What to change
- Add tests in
tests/validators.test.js(or a newtests/safe-regex.test.js)
Done when
npm run test:coverageshows those lines covered- No changes to
src/are needed. If a test reveals a bug, note it in the PR
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 7
- Avg merge
- 1h 17m
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aniru-dh21/snap-validate
-
Use one constant for the 10,000-character input limitPossibly taken @NginxL claimed this today. Opengood first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aniru-dh21/snap-validate#51 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aniru-dh21/snap-validate#40 ·
Maintainers usually reply within 1 day
-
Raise test coverage of `BaseValidator`Possibly taken @sumitkhond111-del claimed this today. Opengood first issue tests
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
aniru-dh21/snap-validate#44 ·
Maintainers usually reply within 1 day
-
Add more postcode countries: India, Germany, AustraliaPossibly taken @mohsin-usmani claimed this today. Openenhancement good first issue
aniru-dh21/snap-validate#41 · 4 comments · 2 assignees ·
Maintainers usually reply within 1 day
-
Unknown country or format codes silently fall back to defaultsPossibly taken @sumitkhond111-del claimed this today. Opendiscussion enhancement
Difficulty 4/5 3-5 days Newbie friendliness 25/100
aniru-dh21/snap-validate#37 ·
Maintainers usually reply within 1 day
All issues in aniru-dh21/snap-validate
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
from-review tech-debt testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
blamechris/chroxy#9520 ·
Maintainers usually reply within 1 day
-
Documentation pleaseOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area/host bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Fei2411/DeepSeek-Bot#3190 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days