-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Added Exact Value/s Condition for String Length & Tests required with README.md Update #2019
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
Changes from 28 commits
ae711d6
f93cf70
cdd2192
27a40c8
cf729d1
be706c4
db5b0c7
2e48053
c194526
21ec415
59abfc7
e1bb810
7c2c0cf
3ee58c0
d3e6ca5
b850b84
acfe071
cdb06a5
70775b4
a71b7ff
dc42e7f
fb0def3
ec1aa91
73dc505
c7605bc
93ac65f
bc693dc
a90171f
57a5633
642e603
bb02daf
2a0a428
1bf1ee4
9fd65ed
fd90691
d09738c
11aa19f
e63e7a5
3ef2588
3b5cbd9
2897ef9
22bb2f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4698,12 +4698,54 @@ describe('Validators', () => { | |
| valid: ['abc', 'de', 'a', ''], | ||
| invalid: ['abcd'], | ||
| }); | ||
| test({ | ||
| validator: 'isLength', | ||
| args: [{ max: 6, exact: 5 }], | ||
| valid: ['abcde', 'fffde', 'allkk'], | ||
| invalid: ['abcd', 'abcdef', 'vfd', 'ff', '', 'k'], | ||
| }); | ||
| test({ | ||
| validator: 'isLength', | ||
| args: [{ max: 6, exact: { } }], | ||
| valid: [], | ||
| invalid: ['abcd', 'abcdef', 'vfd', 'ff', '', 'k'], | ||
| }); | ||
| test({ | ||
| validator: 'isLength', | ||
| args: [{ min: 2, max: 6, exact: 5 }], | ||
| valid: ['abcde', 'fffde', 'allkk'], | ||
| invalid: ['bsa', 'vfvd', 'ff', '', 'k'], | ||
| }); | ||
| test({ | ||
| validator: 'isLength', | ||
| args: [{ min: 1, exact: 2 }], | ||
| valid: ['fg', 'ff', 'po'], | ||
| invalid: ['bsa', 'vfvd', '', 'k'], | ||
| }); | ||
| test({ | ||
| validator: 'isLength', | ||
| args: [{ max: 0 }], | ||
| valid: [''], | ||
| invalid: ['a', 'ab'], | ||
| }); | ||
| test({ | ||
| validator: 'isLength', | ||
| args: [{ min: 5, max: 10, exact: [2, 6, 8, 9] }], | ||
| valid: ['helloguy', 'shopping', 'validator', 'length'], | ||
| invalid: ['abcde', 'abcdefg'], | ||
| }); | ||
| test({ | ||
| validator: 'isLength', | ||
| args: [{ min: 5, max: 10, exact: { first: 6, second: 8, third: 9 } }], | ||
|
||
| valid: ['helloguy', 'shopping', 'validator', 'length'], | ||
| invalid: ['abcde', 'abcdefg', 'abcdefghij'], | ||
| }); | ||
| test({ | ||
|
||
| validator: 'isLength', | ||
| args: [{ exact: '9' }], | ||
| valid: [], | ||
| invalid: ['a', 'abcd', 'abcdefghijkl'], | ||
| }); | ||
bevatsal1122 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| test({ | ||
| validator: 'isLength', | ||
| valid: ['a', '', 'asds'], | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.