Skip to content

Commit

Permalink
feat(IsFQDN): Add a test that asserts numeric chars in tld are reject…
Browse files Browse the repository at this point in the history
…ed by default (#2222)

* Add a test that asserts numeric chars in tld are rejected by default.

Signed-off-by: Aalekh Patel <aalekh@protectchildren.ca>

* Add a new line at the end.

Signed-off-by: Aalekh Patel <aalekh@protectchildren.ca>

---------

Signed-off-by: Aalekh Patel <aalekh@protectchildren.ca>
Co-authored-by: Aalekh Patel <aalekh@protectchildren.ca>
  • Loading branch information
1 parent f303d39 commit ad41eba
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/validators/isFQDN.test.js
@@ -0,0 +1,26 @@
import test from '../testFunctions';

describe('isFQDN', () => {
it('should validate domain names.', () => {
test({
validator: 'isFQDN',
args: [],
valid: [
'google.com',
],
invalid: [
'google.l33t',
],
});
test({
validator: 'isFQDN',
args: [{ allow_numeric_tld: true }],
valid: [
'google.com',
'google.l33t',
],
invalid: [
],
});
});
});

0 comments on commit ad41eba

Please sign in to comment.