Raise test coverage of `BaseValidator`

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@sumitkhond111-del is already working on this.

Since Dec 4, 2026.

  • #46 by @sumitkhond111-del — open
  • #48 by @nijamgouri60 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
testing

Research direction

Start by running npm run test:coverage and inspect the uncovered lines in src/core/BaseValidator.js. Add tests for the listed error paths and assert the actual error messages. Done means line coverage reaches at least 97% with no source changes; two open pull requests already address this issue.

Written by the indexing model from the issue text.

Description

good first issue tests

src/core/BaseValidator.js is at about 90% line coverage. The untested lines are mostly error paths: transform() throwing, min()/max() with a non-string/array/number value, patternAsync() with an input that is too long, arrayOfAsync() with a non-array, and the catch blocks in validate() and validateAsync().

Run npm run test:coverage to see the exact line numbers in the table.

Done when

  • BaseValidator.js is at 97% lines or higher
  • Tests check the actual error messages, not just isValid
  • No source changes. If you find a real bug while testing, open a separate issue.
Dominant language
JavaScript
Stars
0
Forks
7
Avg merge
1h 17m
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aniru-dh21/snap-validate

All issues in aniru-dh21/snap-validate

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.