Skip to content

Commit ad41eba

Browse files
feat(IsFQDN): Add a test that asserts numeric chars in tld are rejected by default (#2222)
* Add a test that asserts numeric chars in tld are rejected by default. Signed-off-by: Aalekh Patel <[email protected]> * Add a new line at the end. Signed-off-by: Aalekh Patel <[email protected]> --------- Signed-off-by: Aalekh Patel <[email protected]> Co-authored-by: Aalekh Patel <[email protected]>
1 parent f303d39 commit ad41eba

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/validators/isFQDN.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import test from '../testFunctions';
2+
3+
describe('isFQDN', () => {
4+
it('should validate domain names.', () => {
5+
test({
6+
validator: 'isFQDN',
7+
args: [],
8+
valid: [
9+
'google.com',
10+
],
11+
invalid: [
12+
'google.l33t',
13+
],
14+
});
15+
test({
16+
validator: 'isFQDN',
17+
args: [{ allow_numeric_tld: true }],
18+
valid: [
19+
'google.com',
20+
'google.l33t',
21+
],
22+
invalid: [
23+
],
24+
});
25+
});
26+
});

0 commit comments

Comments
 (0)