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: Mobile Phone validations Add Mexico #2457

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add references and tests
  • Loading branch information
anonymousFPP committed Sep 25, 2024
commit fbbee4008cdd2be650288cc28cd9f258dffe54ed
17 changes: 17 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15399,5 +15399,22 @@
'mailto:?subject=something&body=something else&cc=something@mail.com&bcc=hello@mail.com,another@mail.com&',
],
});
test({
validator: 'isPhoneNumber',
args: ['en-MX'],
valid: [
'+521234567890',
'+521987654321',
'1234567890', // valid without country code

Check failure on line 15408 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 20

Multiple spaces found before '// valid witho...'

Check failure on line 15408 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 18

Multiple spaces found before '// valid witho...'

Check failure on line 15408 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 16

Multiple spaces found before '// valid witho...'

Check failure on line 15408 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 14

Multiple spaces found before '// valid witho...'

Check failure on line 15408 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 12

Multiple spaces found before '// valid witho...'

Check failure on line 15408 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 10

Multiple spaces found before '// valid witho...'

Check failure on line 15408 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 8

Multiple spaces found before '// valid witho...'
'0987654321',
],
invalid: [
'123456789', // too short

Check failure on line 15412 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 20

Multiple spaces found before '// too short'

Check failure on line 15412 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 18

Multiple spaces found before '// too short'

Check failure on line 15412 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 16

Multiple spaces found before '// too short'

Check failure on line 15412 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 14

Multiple spaces found before '// too short'

Check failure on line 15412 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 12

Multiple spaces found before '// too short'

Check failure on line 15412 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 10

Multiple spaces found before '// too short'

Check failure on line 15412 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 8

Multiple spaces found before '// too short'
'12345678901', // too long
'+531234567890', // wrong country code
'0234567890', // invalid leading digit

Check failure on line 15415 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 20

Multiple spaces found before '// invalid lea...'

Check failure on line 15415 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 18

Multiple spaces found before '// invalid lea...'

Check failure on line 15415 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 16

Multiple spaces found before '// invalid lea...'

Check failure on line 15415 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 14

Multiple spaces found before '// invalid lea...'

Check failure on line 15415 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 12

Multiple spaces found before '// invalid lea...'

Check failure on line 15415 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 10

Multiple spaces found before '// invalid lea...'

Check failure on line 15415 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 8

Multiple spaces found before '// invalid lea...'
'+5212345678901', // too long with country code
],
});

Check failure on line 15418 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 20

Trailing spaces not allowed

Check failure on line 15418 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 18

Trailing spaces not allowed

Check failure on line 15418 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 16

Trailing spaces not allowed

Check failure on line 15418 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 14

Trailing spaces not allowed

Check failure on line 15418 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 12

Trailing spaces not allowed

Check failure on line 15418 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 10

Trailing spaces not allowed

Check failure on line 15418 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 8

Trailing spaces not allowed
});
});
Loading