From ad41ebab5a9185ca13ca8e3725aa56782c8dac9a Mon Sep 17 00:00:00 2001 From: Aalekh Patel Date: Thu, 3 Aug 2023 08:23:17 -0500 Subject: [PATCH] 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 * Add a new line at the end. Signed-off-by: Aalekh Patel --------- Signed-off-by: Aalekh Patel Co-authored-by: Aalekh Patel --- test/validators/isFQDN.test.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/validators/isFQDN.test.js diff --git a/test/validators/isFQDN.test.js b/test/validators/isFQDN.test.js new file mode 100644 index 000000000..134bab005 --- /dev/null +++ b/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: [ + ], + }); + }); +});